From 617f7cda1079a0138265eeabbbe627d6d743c85c Mon Sep 17 00:00:00 2001 From: Katie Stahl Date: Fri, 8 Dec 2023 09:24:53 -0500 Subject: [PATCH 01/25] feat: update API page to show users endpoint for graphql requests * feat: update API page to show users endpoint for graphql requests * feat: update API page to show users endpoint for graphql requests * feat: update API page to show users endpoint for graphql requests --- .../Playground.scss => API/API.scss} | 21 +++++ .../Playground.tsx => API/API.tsx} | 82 +++++++++++-------- client/src/pages/API/index.ts | 1 + client/src/pages/Playground/index.ts | 1 - client/src/routes/public.tsx | 4 +- 5 files changed, 74 insertions(+), 35 deletions(-) rename client/src/pages/{Playground/Playground.scss => API/API.scss} (54%) rename client/src/pages/{Playground/Playground.tsx => API/API.tsx} (81%) create mode 100644 client/src/pages/API/index.ts delete mode 100644 client/src/pages/Playground/index.ts diff --git a/client/src/pages/Playground/Playground.scss b/client/src/pages/API/API.scss similarity index 54% rename from client/src/pages/Playground/Playground.scss rename to client/src/pages/API/API.scss index 199750ef..62e78171 100644 --- a/client/src/pages/Playground/Playground.scss +++ b/client/src/pages/API/API.scss @@ -1,3 +1,24 @@ +.api-page-header { + font-size: 36px; + margin-bottom: 15px; +} + +.api-info-container { + padding: 20px; + p { + margin-bottom: 15px; + code { + color: #c7254e; + } + } +} + +.playground-page-header { + padding-left: 20px; + font-size: 36px; + margin-bottom: 15px; +} + .playground-page-container { background-color: var(--background); display: flex; diff --git a/client/src/pages/Playground/Playground.tsx b/client/src/pages/API/API.tsx similarity index 81% rename from client/src/pages/Playground/Playground.tsx rename to client/src/pages/API/API.tsx index 5024497a..c1256292 100644 --- a/client/src/pages/Playground/Playground.tsx +++ b/client/src/pages/API/API.tsx @@ -1,6 +1,6 @@ // hooks/dependencies import { useState } from 'react'; -import './Playground.scss'; +import './API.scss'; import { API_URL } from 'config'; // graphiql @@ -185,7 +185,7 @@ const query6 = ` const fetcher = createGraphiQLFetcher({ url: API_URL ?? '' }); -export const Playground = () => { +export const API = () => { const [isCopied, setIsCopied] = useState(false); const onCopyText = () => { @@ -339,37 +339,55 @@ export const Playground = () => { ]; return ( -
-
- {sectionsMap.map((section) => { - return ( - - } - > -
- {section.header} -
-
- - {section.sectionContent} - -
- ); - })} +
+
+
API Documentation
+

+ The DGIdb API can be used to query for drug-gene interactions in your + own applications. +

+

+ To query the API, make GraphQL queries to:{' '} + https://dgidb.org/api/graphql +

+

+ For examples and to experiment with API requests in your browser, + refer to the Playground below. +

-
- +
Playground
+
+
+ {sectionsMap.map((section) => { + return ( + + } + > +
+ {section.header} +
+
+ + {section.sectionContent} + +
+ ); + })} +
+
+ +
); diff --git a/client/src/pages/API/index.ts b/client/src/pages/API/index.ts new file mode 100644 index 00000000..6e432e7c --- /dev/null +++ b/client/src/pages/API/index.ts @@ -0,0 +1 @@ +export * from './API'; diff --git a/client/src/pages/Playground/index.ts b/client/src/pages/Playground/index.ts deleted file mode 100644 index 469667af..00000000 --- a/client/src/pages/Playground/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './Playground'; diff --git a/client/src/routes/public.tsx b/client/src/routes/public.tsx index be874b60..4cb6c843 100644 --- a/client/src/routes/public.tsx +++ b/client/src/routes/public.tsx @@ -11,7 +11,7 @@ import { DrugRecord } from 'components/Drug/DrugRecord'; import { MainLayout } from 'components/Layout'; import { About } from 'pages/About'; import { Downloads } from 'pages/Downloads'; -import { Playground } from 'pages/Playground'; +import { API } from 'pages/API'; import { InteractionRecord } from 'components/Interaction/InteractionRecord'; const App = () => { @@ -91,7 +91,7 @@ export const Routes = () => { { path: '/browse/sources', element: }, { path: '/about', element: }, { path: '/downloads', element: }, - { path: '/api', element: }, + { path: '/api', element: }, { path: '/', element: }, { path: '*', element: }, ], From 8dd7961e787fbb8aeb939ed2d83d704ec96a31a9 Mon Sep 17 00:00:00 2001 From: Katie Stahl Date: Fri, 8 Dec 2023 09:25:31 -0500 Subject: [PATCH 02/25] feat: add 404 error page to drugs, genes, and interactions that have no data (#456) * feat: update API page to show users endpoint for graphql requests * feat: update API page to show users endpoint for graphql requests * feat: update API page to show users endpoint for graphql requests * feat: add error message when data not found and fixing footer position * feat: add error message when data not found * style: removing console log * cleaning up code * refactor: extracting variable for interaction * feat: add 404 error page to drugs, genes, and interactions that have no data --- client/public/images/dgidb-404-logo.png | Bin 0 -> 21652 bytes .../components/Drug/DrugRecord/DrugRecord.tsx | 14 +- .../components/Gene/GeneRecord/GeneRecord.tsx | 14 +- .../InteractionRecord/InteractionRecord.tsx | 213 +++++++++--------- client/src/components/Layout/MainLayout.scss | 6 + .../Shared/NotFoundError/NotFoundError.scss | 7 + .../Shared/NotFoundError/NotFoundError.tsx | 14 ++ .../ReleaseInformation.scss | 2 +- 8 files changed, 164 insertions(+), 106 deletions(-) create mode 100644 client/public/images/dgidb-404-logo.png create mode 100644 client/src/components/Shared/NotFoundError/NotFoundError.scss create mode 100644 client/src/components/Shared/NotFoundError/NotFoundError.tsx diff --git a/client/public/images/dgidb-404-logo.png b/client/public/images/dgidb-404-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..8a437ee3e2dfadc6b7f03c1f6cf4f7e1bec0e2ff GIT binary patch literal 21652 zcmaI6bzGDG_dYI-A|*;A0tzZ1AZ#?!2uMiBMoVpUcXx+U0@6K3jP6Dp4I2&8jP4Nl z^7_1gfB*j4V`tmhxzF=D*SXHQ?+8_8IpQa@PaZvbL@fVVTJ6yzY}BJiSTTe+50<@( z3eyL}t?CyInTNLk4jEh=ypQiCxZjH5;}L#f6~TIh_3&kmH-dcZG7p~uIHdX5rFq{= z136`Q-b(SX$w-T;ivqrUgyuik6{Yn|Kz1(;G9n`)rNp(gR7}6eWlGT5yLv?1+53CC z1UXoH2Y5${zOXR{S%n0JN5|#;N-x$_F;ey@v^295bI6YhNl1>(EXskoIr}3YFL00Womel$C`xyq8eR%$*x~y3K}Uwfw;;M}eoPcc_hkk*hCAkD4(;CG-{UDKL^Lej zpWokK-~T(kKi|JR*g87hJ3qmkF3+y)tnRJOuU;Mf+g;zAnV4B$+SuPbINCnGJiJ~& zEe>qnZ2#RE`!ja9eY&->JvTMyLXAZBBYkM*r^irTtzDBNQv=Y94md;MsZ3vvsF`i7jSf9t+TA03==r0%~yx?h=HuPCk9 zSlpgKPW5&6tu1VN(aa3>PS{d)wluVs6_?gj)&$W0ots+xsdlrwb`(grzKHs({35Kg zc>qGy+*I3DSynmNHP+icoRghnOj!)2YMU6EYisDMuc@D#ShJ#P(5KAqZXK$ss6tdB z&iDRBaqpo=SEhy+)t<*9`=%A1`;QDxZY}S{@E)Y&)dmTXZaRaLEMWeKT^%9s#@zi*XIwaD;f%{u6$n2Y%ibetzD*mJqc#m zvY@KT*10XTzDZWyEy}A%h)+n>Iw(Z$)n-JK)3hHK`FEn5*s6A9Z( zLlpttMaavIyWfbTx!c>h^8K0M-RjHR%kjp<%Zt;K!RDlgB2zt=mzL0QpWV$|P|^QJ z->*o{6Lb~GRSfxE_vMh-ES$;Qz;cr4$ebBYsi(Jy9mG+P%#LkE!3<_nQVeH8Vx_D8 z;C@Ec^%su`@8CD1QTz=Jg^A=};1G0h><1EpaNO*k<#=iEz;f z&tqKd0P$C3g#Ujp)v8~?`s$kBs&r`S=qe4{4ZvV+?F(0M0b<}a*-yRl=BSd)%%Gs4 z*49b%FpImq!Jiva4%UF>T9fbjx0#ulazg*^GUXl&$tDZm&w1VV{7wfh>f~PuWNLhF z7QPXVmV4i-y##oSTa>h!I!*YMP7IgRJW1UCebs)zbbe?tMTU2DoUa=68KE-Mizz^} z{HUJni@C4&p-YC=4>me;h>Pa?g!ws(0j&c@`acA6w+{DxP7nX5Va$p$PGnD%wZ4Sc zHwp3bGU8RNjy-#D?fJI)SrJ8I@+?m3j8}=7859cjFcax*RekQB&6oyxXRq8Bd{pLr!Q#y^P7ytkek;ykOkf{hdV-0xK z{;qmDV0;kwZ6%FRix$Xz6Dr#LboDsq=dUuhtyZ_C-iE1j^)$ zyln8`RMYogt8<=Ah*p+=Y!q@SBD}fla=UUBU4oIHhi5gY}>ZYO?_Bwd|~A zT(AGp3;LBP!UKSz6gR9YBw6(nu>!#+d>ER5!jAn2Sx?FKNoM*=hmCVrX2QtXp*}%Zv?HiEKp4shIHIo^Be>+a`pB`m;)^gM_X@v^6m}H*YJi z8d%q7?@be~czDvW(`5{@y^O$@Z=_G_ziioV)UXrj)ez&*wN9fTP1b9xv=&Ue%LA12 z>DJ7JGn>yX$6lRkg>lp_$U-ZenUhuCaYPdkY02l7K=ue z)_yy`Zu@g{Ov2u1#GaYi5JU|2q9UlQ)2*`PpGeLqbJYle#&+FCrJm3(7-wR#ySZn( z?df{Ad2k<;K(@{{)Fv6lRDs%QcuCj1QwzQc?JM0W-$-Jn9cavn&Ohz017>s!68J-VcDA>h@%84Y z7lb~h$Gn*(w=4N`(XqozYeO71Gc#i_Ix8sOTONbe}$$hV#NrJX^cPls+n=~T*HFT6ak?{*O^9@~N{pTtIyIJUvH{5EVaa0kwf zSgb2I!%?-N;vhN*k{vlz@gl>HxdpXrZ90H+6Xx!NSmq;F=5OM5ZTcK`%<#2(gy=hh zWnXx86&}Un*^2l+jFC@7Z6RbK$wG8LXWrK3pdQVT6SQrFrov$5+=KLKQ(LvVZe-OB zoWWx1I*Z)4r@uc+|+Moc$fJ zU<_@cQS#La-#4TYY5dGH`^}EGR9V@ODf!MBx4USr`<`rNV}n-MnT@j$?|Xz`6~KV^ z=Lf2{q6R1X>&Mzp%sznLdcd9+?!5T+?VF684B$zOaZJ19fk*I|MF^zrX6%Zl7xS(c zqsm%IT>F3re-jG#DjJ**mj+&2q3a9mDFz&>Uq6e1tmDq|A^y%hwi3jB>Ymoi}{&s_^A5@>Z>0z{EB1-*SFiK?rX~M2u4KxJA%SJ;A)G zCP%)90UD(6SzMA?Sgo(l?IJ(Ew;U_~+b54vR~g4eXwv6hQ=<<^z_-GrV_T8^{*IR~ z%?<2ITg?Hu2z*t@@OHGVlL^k+1;#qat`VQbvKDI){`!r2w5X9^vjMn#Lf7Z{WnAt| zBiCz>%c9!@Rke7CftUv=%|f`T5xWd70rM7s3iWfkzWNt%uJDnU=vnPdvq<*WJR+jl zU)Id;-e7&7i6A^D)3|v%>c=M>HQo=nX$%CNl)vNRG2|Ek2wpZH?`+{yp>rNG#tX@m z*vaCftx3=qMItL~GPCG3e+;E?=hZlVQ_R)No0T8b9xgyg9);Oy(kjGc!(;4!3RH4E zUrQH3V*ZH)MEOPsp{dc^fiVUun3h7lB`ruMkTz3xvf7Og$7c8re`soGz2T!sx+3QB zA+5ap_~MRN2vxREs9r@SquoP;Z?zU>uARy0%vao9Ed}evLq4P)Q-ou@MFJEpDbjS6 zyp*u#nztS7#sUaW(x=EMQ7zM3&ID4v3ksIDR<>4qjwDk$upjMRbeWl5$9t*LM%IdI z*8TS<>LDE=DKnnrCr!B#$6semT@smBd&GP}pY-D)$EQqP9$wh(71qp-cCN&7Cl%k6fCR zWdmxpn&z1E5FvA#ckc%PR7zL!cUc{F{w$q0)aY6xJKM&Iht7AU6^ogBbfRYic(U-c zmMm{Cv(~vo;5s$gP$`(|4PbEHquOPLAjB%m^PDCIcEHCY#wx~6AYlP$s=#|Ol0hSp zB}OkCr?R}cdelIV?!nj$K-A#%bsyc4e`yiZx=JyHG`CYZPNjX0S5J~-O;1d&*6CL4 zzo=CS*Li2}x`|$gDnP_d&lQ!d7E9imQ#UI4QL_O>@9xKS&3-E$U*WPUNz`gdP5-9KlmOQ z8Z8RVglat{$l495j7T3>bKK~EFOSy`aeZ-)^Ts|W^bELNDOr$AKXVU{KWUPbrBZw61`2JRa`|xQlwN+ae+%BIXQy0Q^!Zo zR~+&KN^+Q{es~`V)WsLog1lcw-zLxg>(5q-PAPAh@*WEf;$otnwJ?zt7a)}qgEDi# zi<0HDft54W36{jl6uS!_Hh&d;T0YUIU4n6UU!VLPbi5v)O7Hm_-0~%uZONwFFE~Yv zUk?ExTv)XVLXas#n*2HLQh)!OLwcsr9iGow)FyE?_o!}4gjH$LtwW6VUyOWOVp zEy~zQOjxX)JWiF%nbJsTs1GlE&v{-=JJgQ_ECL%}*QR^MPGnp>Q6*#I%*DNRZe6FX z`d4p80x%34IMh;KJ33S9DpQJ%`yCmT{cb}rH)_B-JBOyzgXZ{M^6l0IfyED&*AL{( zUD>%~#}JFPX><>_18gn%yO?v+G&{78>*+b~-gi?CKKZJ^5jf6s96UZF&o(Nyb-w&T z1 zJnBX>KpNk-z&Zv|0!>gRwsG}{V~Q4wDDO+%D-1-n#yeyYjRPCcZU#RH|BZgtuDE$c zef+M4{(?O~sj?tU9MZw?BwEhAgRRT*@YTCFgglRG4dxd^OXjb8g1nZLpz4i=e_*FC zhI~Jg8|djZ@!QmNE6v!zu-MueNIa4KXIoyfdc5fBgd>DC2ez82bAy4njL~7?M=Cev9HUoz9;*GWgt6e*zODl`YcsG2RDrc zc#qdNzW<=)Z@;k}ACvu{dhS1-IS(vFOGW?nT*YIlpgG{Kq-ihdV;b9=*U%@EmoVJ`{dZEBt_?8Bn<30i`Kde^`pvwH{3U!ZasTp zpB6I0H3Q~7l7{L+K10Ynu?WLFZ%9hUI8_UpZ5k?? zIe?o8+nMk(*=g8z?h!(gMj5ikX?<|O@A5CggtzQ5$i(S|{)PM5y|?Tksn_Pk#M+C# zBSduL_iXj&(lzhKwttS@espr6nrMvLv;GpyO!(J1Ff@EXGpIy9NL60yF;np8H#zZ# zEb)cGQK7F`4VD>4Uqvj+fBEr-RWbTzy*JBg*z5Xq{q(jIQvwO-SE{E2_ix@F`?PI} zjwIb{DQM}5c6iO*;^4#!bC(8K*-s}BZl(uh>Qsv6`)|dw?KZk!eQB&_Z2kL`M2l=g zgb5Ycsx?FAjM_KhEU$WkE{RsXCyZ>h`gT8{$U>njMI-S()LY)$|Kf7N_t(tQ@b3e+ z#@w%60IJ>8?!qg;CarJaTQ5u3x=qJ#NUIRb>f)$*Wl;vpEX7JcvFoX>Hh)!7U1Ny{GPVOdXZMlkoFP$9hixsbxLJNHk zC59o^Xbqn7bX~Vzv~2*T%iEs;;&M&$dMTHI+2r}-(bTO9nMZHsef%$?9SX6m9orfh z8e}`Q-Y`oXpMzhC%xM!HF}$Ibrj-+?QQDwrq}&DU(R#SX$bHNuk|tA0Nf;R08{+Adg%AEI5YB7M(I2K2rv>%n1y}|^U!eOy zLByS~vClAa3@2adU04!FV2mK}$Gc8*Bg_v`8H*mHg8j5FiHysl3#Nnscg&t#N~4iF z8}`{;cfs<4z2O1gK)y;4MpfmBvVhaGPFXfJf;aZaJ-{rPh&A++NiblN>USo#6ue!k z6W|oH2pj8%B{Pd|aGhvqOrp9tOG?uL5oQW|; zc}5V&7$ENY>^dVFGRoH`7g^w4>H86@F2N+J9k&i?hWpO1`rj-9K>QG40#Ci<*~fP# z(u8RHgyrq=g|_X`^y=eCUSee+hYr03D`g<^Cm{uN?V5R&c22gINdYCm%`FBuB!H}? zGvt1{8KmCLjeGXC?tL#Ml+X?RU#KPV2gD*B8SV7WGH)lNA&-Qc=o!4xOA}+_i`tIo z<1cu{5uJyFxJE>QF`h9XBA{6d#M{mxvRti$ z^~5@^3}soq2J%(p$<@nIw$ytX>o(P-$7N5Zj#HU>;>}^BEu~c}#|-*s;VSy*R;|#@*d0#8eO|5`~da(mKZIP~As|ecb5yaQ!Nwce+I=h{P+#3>Wie zt^0Z_EUOLT?9$o#5`Z$Q{0duzYw?0#jsS6*69bSjgtSmiddG@3JQ#pu7;DPOzF6@3 zG~BB3p`jblO){Ds5WW#g=&6i=277N`Kk~b5MR_HGoT4|IlAJgP5T3=&fqeHxxJG&8 zU!92aq?Ye=CoKJkebe)%7zJv(Rbjd>R+^b)T@<|WBL9);%K^r>;1A`==k5P#$IgoR zgfi7&N!@9IZUkV0EU{IOm#rp;uIViZj0YO~#USes@Ue54R0gCvw5%t!13?(0TRajH z9$5RRNu?~DW}1%4@BvL;v>Bnsi`W?~T^nK!u(a0c9=$xi4s(!t^~e-z37U0rwLDEc zuR@45Z&tj+j3c}y3YCS0L~Rw0w=s)kjXj4tkQDf^tSL4V2uv)@DmAjId(J%i-6jU~ zOLSO>0y&jWX{5X>z}8<&2NRYB8hi6^`mDqg*vhGuN{KnDtl0X+PcnBfJf*@60$gL< z)%&~;F00}rsD*bCKgi3Y;t!I_N9g#NSdNA^xONB>3Bs|Buj7vKc=VXjf zdtd-L@NU%lZRDBdJ$N}C#h?tRD&b2PbD5_gJIGzivwAu9d$|(M`7e7BU zGm6#`Swg9R2ee^W;j*wx>tjo+}KiF!F9l%^9f>xdhzhEd8$b|(P>7uC(^RSS}J^0k*cQ2MhTlF&1m?1czB2P7XSA3Nmr!n+B zHy5hvHC&vHV(@tdVOOi`m(BZ^$E|||?o{NvFpQC?~+Fq*^~afn-)yipB_&v>*a7|Bh~nUZvoKed4#Ft^3`M*dA^?U zeAm6zfP$v;`tj9go5<@q`OSgo@JI+{*y|q*MCN?W--f8ezP2#~ASHI|`Fq_6n*~!@J%Inv+0eDy38#pQx?@BNJm8 z&K`_sTF^15q8ngRF>MXp+fGsRKiwsixW)>hg>Qi3?CAo(hI4U0p$N};UV78N5Hv&+ z3N)j`&?*f80@8zG-klTZ1={c{OYd3%Sj;m+y~}rp_N3uVU4{7iahPChaH)pwH$&1t z7@Y5+CaO`OGS9wdT=OnKNOQYOhp442tewYa`cjhEHIQs>3(*!6&*j6ojN|)B+NUQx zxElp`&~U0q#86MsZ!5Bq?l1am`Fd<`KMt|Jlqi;^%k7($8ZljdmHCy}7nk+-&4Tya z>ecz|o50!umPB)Rz@domxk=H0oi52{qBk0R$TNDQEqYJepzd{)hlL4r7CmP zlupEARQ3l(M)BcXj{mN~x-CQj@ z&X2j6FUcz0e#kXiY6hi1&+;vnY#8 z?B}p8GCcj&=|2y-P-bFe_o}@W+@{}b>?{m;(1G;1DyjsID=AG*oJywsal2>}b0l~L zmNY>@`jP?`uq*GMzB&2wfMY(zDu-xnW}Zx{aYHls!UegGA_UgO;uWJED-PQF)2{qguS(C9*^oF;EHW z?PLmuyhkOt#Y1jkRa~Q>@PtzSBsgXK_?k#>Y*i;NVP#Uv?Sv0p^lPHfD8w&SzsB?v40%^tMPd z=RNE%fOGGkQ06g;PzD3WrF`mzN>`$9pD646!f}8@=)IS8U`rM{*uToS(K>I@jN2_0 z>8h2QOorFUa2`#_0oL$KdTP5jvcdeZ&oPTT!%qDA#_FDYfAt8vd@4MaCI?!ZZ%8O} zp%~iTpqoH3v>fla;GT$6s5sItHz`2CQpyq)KIif+7*(ECv3xzEGkrn)q|Tf<5b+=~ zFgPt`H&^sL%=1QWU)-DxP8X?di!#QWH)U~7%xL;W%2R1*w=;H^v~!n)&3E615UX*ElH=Uo8v8>>2)p-gN31wqsngxRvj9fa`5{)wG%nV1>|2e z%F+c|d{jM#hFeN!_2S;>D+O`pwjQw>UKgHv^*48hKSD`YR@V8eb$`IA#thK`K|5b-g(}L{v&0WQZIRf ztXD-f)6H4mu`ZlR$FH>Wj(1wn*TxcF1(a+%_3<~xIzUtBr5B$$K0m!?qJ_TAGMbn% z&1xG~{9f?W${-r@{DHceQD;Y>8W>N1aO)kmO}Go&@%slSCYJCq)1+u4&NSuQcsm=> zji|eCYBJOxbbzd-ak_mx z8;`PQwv-lo-Y|WPN`tVod|r*`68^-_4?$#_q8_p9WbDtjF`TB;kmJ&AT%Ct`*$P@k z4Mg;*1rf{Q()BA317;z$OhGW5^NPOnrh!OeChGp6TkOh0zxv}hP-Js62g~OL49i;C zp3WQ-<88R$kE~=-@Kft{q9+Zp4PXbO5l&7d-oECoWGX8z%Ov)Lus4Du9_r`WV2~3j z3oHtc&ZO6*y~Dw0DfJ~wVl_?Y#%?*srS*iuSp3M{EMo$e&8@Kb#u4VJHUH%C*f(qG zVhUZ)%R_#$os(dz!hvu^X@gNv_l9gRfzJS-F6LCV@4$8mZ+DFb5yN&$@-2E(j0rU# z{+uu-FO*omGx`-i-?Sdl6ymvoQ3+=$z{FN-xiOdYqSI=n;9+NvlM6~%+Iy1rzj!FVDC%v zb%ArJzC->Lu`15gS8Sj?LxgM=|A^3#QMx)3*Fatl2Iz?8M`NSj(|w$7;>{jUDi}Gt zxr{8;gePFyM~&z(XN6BQc7NAjPEC7tjelCB5X+^9)hvJC?%wnLmHvF;L+frkj~D*p zV8$=~B!Ow`#t+}XX72)(@G@x07X_G6)?T6_zCM?7A-P|CU>8LE-#9#WsT|bbwgafb z*LEB-|HY4FWu|%3DxKOH-*S zMBYXRGT2GSLvn1Otq!J3FaNn#&H=MJl1KD-%J0pRO;;_8QE9+!kll9zKCOqfi6Es| zE)=#0)ROx_kT(S9Tv*@(8!V0v?dR9Xo9BXf3mc76a*ZJNF*YpFSXehav>7`(HdLx$;Xu)mOMtGH$yo3-14qxqnMj+a~Kt_RZkIGId; z*Fa_SfOImB-bnk-4g80xV^8|v`t(HUJ!4rfU>4J^)Wfu)9sI)hRc;%Fy=o&*`jI{2Jf-|o>NZ`}gnuLr5_IP_ia za=Oph921( zk_@g&IuOT2`wipRDQ;JzMcYeSNZy+geZ{MIm1%z5un;>beOvyEiERNX*G zx72Wlt?)eUi0v18PKduNsOOZU9bWkTeg~kW_A>Q^Ig8 z?<_<@#0XV1qmL#8#%eX-7aLAzwYs~wZj9xz#eK))RecJH$BYSMbz}tYr3qU0|8}-? z0QdYQE9NgjH9q)}UtDpC4Dt3zWMqf}%_R%XD?}6WqX*6&c5%tXR|Wgf5m9vXFzPeT zG&^Vj+>wE_qNa64ubv8NM?qX8l^cA|H~zU4DhZ)<2Qer$;kBf#Wd^O6=)YBOtl=^+ z$QOH`ren2*UN7FbY?0JoUi*_6x)R^jH;!0jpjNx*kU8el4t(}q6rpF`^VR4S0R@4-yAFG3^%`h-W1YriZm{8 z9$@2jaM0Nai)wxmq=ZAx3Df4@6V+(&%ieUhx(Z@j>wnUi^>s4cY&wUDd6s)&1O=ET zS)~V-oazx?khY>FazP&PBDeN?=ni%->(fR|GmHsD_{e%%+7}3>mva@Oo5e zclusv7dlU&0-&Kb|MLK`#r9#;1O~JX+C(R9L)C@WyjDR`OC%ShT)1`^M`S8Y#ET_R zm1VZ~#@nWV;t5Km=_Pil74ApAb(?_Z7^q`7q|ztEK=`!r2MgL;-7~>}KG7;^*hNbX zr!JY~$_)4{RwSg@@%s+_H;E2z<)q_kP-NcYXesFc8W}!RB54EZ-h;h z-0QX=(t0l_E$*8W*#E*6@E245AB(e2Vdp;_#YskBx5=neLs=9cmKoI(l&o!NMHBn1 zV7lZfy834AvAt3q&84>(_LY#lhlj6kMPF3p<%NYwf5Ild7c09!B(^k|$x1120c97Y zp~uU~vK4T;`#2Z1-z%^3dfkZ;UO9>J2E*1LxPo+S8soM;bT<7uZufIqJQrJ|U$hG> z&UsoO=9h*O42V%(HhOB*;^QAr^3_7ix5$g*M1D zu&e&>pk_?cJ~Cy4r3Aly@7|eTjovbe=Zkf|_uFjTFix3Uzaae+Gt3^9)Mboz;^!5m zAR`|9(UoYLb;Ga;c|}|<==9Pe>=6no$z6}KMFpgS@{HIvt|8vpD)?wWx|#pMtMD~S zp76>sNwjpzSa3&hzE-t|uc)T(CA57KU7e9{`mC`d zIO5Ypd+Y2W14XN|t)$0sub$5y#O~_O0IeNw@!I@2J0sx9mEsQx`n)-tvvR+t`6SHy zzRJz-lY_=r`i_gRVg}#e$8>qM)5* z0Pzf&n(u3P#v@`SoEZYiCmDyT_m8ky&y>b{;`z1}^Y)@P7l+n&9n)rv&xb!Y?;mXj zS#o5H{=6FgBkIT%AJZ&0*El1J1=F^xy$M?|sAk$F*Ugj$-+XT0h{~5rIIBqGSDYDR zVf>kKw{rEZ?sGb0WDxAAIw1ySU&G_uE{po-lh(tVz{Z7mxe*i?uhN9Uo*?~M_j#Zw z)wi&~Rdp)CU&k z7wTu-uO;YjHOo2u2j47V1dWKdZxFe8k-55K-LZbrO8%RuCSVqjIqc>Sp|6}tG(W;3 zC$B4eibEc36Ax&%7Aa_Y$sj4V4XZ&~d|QcE*;`Xb!g&))s2(!t(` zY9qc?Vht->dZ2sKM>~tr{XGc{Tn6Q}>QaZUWOxsYdy#|bG3svri`Q(eVTbZK1`Gem zwyk(r^<~^+jUVV;j@O)eG&`v79UR-LG)7>;CeL>FckX3Us~EqWo<@TjpWh?~ltQAV zLc=jD))}LfQ{e0#@z+e~L(Ot|uiu&VUo8dcG zzx*;9e6I-_%yEDb(p!V=on9m|vWCgY0L7tI9#1}pj_AR~tYK|U8_dCe3`R5E}5zUl(==VG>o zWG`HQpeu8#@la1)$w`>;^?;fcGq9@X+c2l3YOb*-OonZZ>}k*3z!Td9lLif5ZC~4} zb{)L3ukZaix8tU%t&up{4G`>%hJ6c|E`8TNFt&NK6di6chpOxZ{NOf{>ZZiZP_&lj z+^z5FaT0rgeVd1YRZ+&e{A)?TBWl+e%>|O;1$!c&$o-_3cMGdmK7}jH_N-U6FHzbT zjph!7&Ct_p(W|Ejg?36>APL&@TU2R|L7&ZkV6k{pV66A*K?Eoq=Dt4ebn$4Ke@QCR zOQ5L0|6?%yG{794NMdxBNm2ecy^l%44^C7F*+uD)$+8H+9AlS4`Re*fnTid&3h3 zBlsFu7IO8b1P=C)z*i9mkMYHPg>aL<<$xJ$8Q+^toaY4MA0XQt*hpNFVZ zKgOha`1ki=J^68euTv&QUw`CN-_z#0G7V%kfrefAEg{=NM_IGGD%=*ud5V=_iCS22 zYx?ADKcV3gy=zjW(CzxdxErV@0P=&4!J^jdG2W0S;HR~u`x=Qv2s-(0Mpo{ZFN1-D zNIvB0^?Bny_4O7f9pyO$G*|Aku47JrZreZdbp%%Pyb*>-`8V|K+f2NQ>!Im9U^*kf zE5O$=c%Z;V1l{@phG_}{FSSi9-dQoF_xW-*P#SlCXE8_PTW<<$9asl536ASZ$r{O{ z%!9otoht6sbJs8(YD=$#Y1!H!~V->{Ua3s#neG7Ubyfp3RE)m_D#b{`b7G{To~o$ZSOD9L=ULW%Ksrf#!Axc5dzj*oz-~A4)xQ(f z^Ez}z)dNiuUX^d_`3|H&YJOsZimrdh@&v(hIskJl3-k662P0b7&s-cGo@s;IgbV#+ zHD~V*P`~uHP&>qQtO?z2yO|${o3NYDB=%DR>^E%AB?nc%$eTy@oeasA)y)M$GYQ)cT9$*4KPC6;VxbCJ`l>#N(T%M7xDd~ z5$4gH<-HXZ{C4*&E?62D4C(st?m8Bw$WVTiErwSf7g1gXCSuB-S;88uEvG$}C+4GY z+dFpdN>h;qp@94#I^s_2(>G}C4$#E*EWfK;z#e|oX{(*Oy!5DxH=4`UxiqxN{^^dU z8Rt_J358@Ewqnx{#$zl*vV+a1C9%4`z&1-1!U2Thzn`Qc5j6-4xmWE0)M1)M6UZDG zBA!}6P9b}tK2K%I4Zhv)7LPAp6+P8V$;>G?l$n-nc3o4j$js0%kfS+%p)-c~9ak_h zc~-hbt5cTuayRN{?0iKgr&kD<>?v7DVRTF0BCRw!3;ai~A*e79voQ(=v z3$o+y%n;?d==e&3v?ZHn&4)Duxb(dCp`rLMmZ+b|0P(dARPs8jj#2 zXY+A>aWGe}+igo*yDkzi73E{&E1_}nO!vgqrVG;)GRWZMvIPEN;4wI4Xx1R60*;Fw zCy<^5f3g$(diA7L%EM%BPG}l7;~Z1&Gm&E-PT%TT1bImrpj1`w+WT1FnX^lF##7TY zqWsDg%quCT*aT!+WB;CLO`uL1HgZ zF75NjSqtroP5IVUZDNnguWX$K$4o&vky1)KlOsNaWz5elgLkQno$rp-3gLYG1l@NN>5KCQsk**gI#R} zBB=4DYc_fb7UEk$3Ut5-IUQ^0LhrshA3v4h{Gm|q`aHvTAn6KaM@f9OcE|s%!Sz-K z#Pthfu+v1M%1`2~Y+OcJx|VUniIo@vN8smtzF$V@pB|FA0u8?_S)#od=H7Ksnnh_k zZu|)$VpGX#v0r)0bX%(DFr`DH7wJ5G&hbzlbjK?M0`mM?1r2rC2U+=8z$O^MluOF& zMv4k58IAa@dA5yxYV97j?CZY$`wZV5QjhrF_|mQUqL=9>AEyNf-G_N$7PCP6UQP@n zlJN%2?z+AHSr9eVF7c`hL{JPd@sJ`id&A zl1)8+i1WuAx;Bli=`XHX-YCHb^eGIaIKotF`y2Kv_H0_nf6f|YW$O@U3d3gLilxI! z=fOXwF@Bb9gDSd47Pv_Q(hcMGMy$+DltZc3#T-@orUPtl;Ji2B2Ro3!x}veLh58vTf1{JT?gGPCPw3>#JkppGgo~J*jvYjPe2sa57v6kDPME zSvaDKMTc*#<`*WhsD>h{jK$|R zfbqu8xiitZn#ITQhb`;gwyy4DJUz-S7??wQJA)LPb7cEB*wve`DYT|CBvqwlb1NE$ zPLbdG;bNs;4B4S(2Jda>IBAb{M-f9461D=eKky^059TlDr5-%m5YL|d?fCusy+~i} z%hZy;N_2W>UzV9;>Mvq-En7Y`!PNFpz-U%JBhziEm^ZGFw=zNyuOI(QUoPb4Di+Z@ zb+{#7gxWj1F_stlDK))N1(X0iJRYan5Jd>duU}+$8N1=RJ-Zb0l~G?f*UeeF?_!Ki18KL1u$|yM)jPEXDEG za>Efe=v@UyIZnz?_f2nR0qqO!i#g+!SG_S4uV<7)`dL{m97?Vzdn6Q(Z)6r~PvCafwH$fJ)=9*WecP33N z6!r?*Se>bCpV|BMp>g*Zx<0V;!&3s9s1I%_*%~NW!QJ@~_yIZJ?x(v{aO-h}>q;9o z7*=JR2N|r+%s&>eU|OpgDtqYDz&HQ>>QLdDUia?6kX3O!jET(S8kIL4>gh5{9sUc` zDRlwy=ll-5&)vN(uUV@ZMm#8u2lXPc(*(21KJjerHXz+i%nAf=XXWS%_-(l^P_28~ zQiIFRUkFx{BT6yQ?ee|e|DzTQ2b3P;`i^ov-Fbd<%69DOFa%*l`MwR}%F_Dg|CMm% z@lbXDzY-}+=t(uigGw8sj1pQDEtV&1xMN?^9osOJHI+!lTF8=Y$##upn8of%mPBOk zFxj#-UBhF!WbHS7fB)Xk=e|G7`*Y6g+;cwXGKq?G<}55|!&pjX5;9L^5}}s=l}B{x ztTpm`VDimMW7<+-A-5a**l?zCS(oO?U%T@K^f49@1|)CSo4hcNh4_Exc_f=;nf+F;-3FmSiqm)4sP9|1kq}P zp$16Q*83|5t=vO*^(Y^?j^6^LkRxLI>*<+UI?>m8j6R**4ukAPOTBLYpdjbxw zc@5U+H-G~bzCBf>C2;+B-c}Yg9vpN#xNhRD{S0rJ-hkM#1*pj6-X%t|aC)(8*k`H{ zL-Q%p`y#wP^a(Vkrx{>46+iURjEI7#+aZtFp_%phBSd$nksCSCuJ!j|=*iDxK-3E!5fky;0|)Arb8o`H$+&)hYJvupP_G#j}39%z}rb_nL+qCaOd(UqsFJZp{R=g&>?!I_`Xb$!lYf=^~E zFA|#plo7{h{b)w|H~1Tx5pb)MQaJJ`gXiXoiQllWI1Y(hZF^wos584(lk1O5^~s#g z|Dkp0BbsstMpaeqq&y8ZHR0+Q#82gV%CQzmRdlSt=sWX>2OK?A)zL*YS~u~NN&kKX z(tQRvNjC$PA6H|0D2YCq%lSXn1)d<+pFjf~xtW)vc20ot9!-TGiJr4^+EwD`BhYnK`c;?Yz-rGqSckEF$}k*y%QlsnLCF+fwe+ZsNCT zZ{T4oc{UZ$2u?j#aOEh>(9j8mKCM=Llw0(cmTyR_+8ky0@VW%Nj={XQ`VI3tuWa4rB7Qgu?Sor2lXJSO9qQ!58C$agMa!*`PI>@q4h+hb#LFsMq51i z4Sn}JKtzR@rSeg(S6$2E5#$k9ww~}uo>3-Z$23E?hM$xMUlS9nsoG6lgwospRar8H|cF z8b=EL^bua&nhYdoSuadz@)de(_r&d?Gs9FwWu(Tc@5Ji%po2nl0wtnZJK_+!@I%*OXt!?IyMePdc&;9ucIth z3g9L;YK^q|{GcCg2vz#Ex;TCM$;Mx+M=PAa(22#C+(#kxsb1cB$*zRVh%=?d_1kkl zcBiU_tS!067iuMSzWy)eWth#zn7dZrL)ZU4opw3h$!_pi`eU>zda|v|^w#SmXUj9x z8MgJcq4jsQOpVGPY^|XwDgoTIgP-y)zl#b+e*C!m@cYEdmQfWvK_6?bN@FLC)X%c3 zYeO8^6-qYN%o3}<6Ixlc2XnTT@MpNpF6{WEy7TmBC}>65_GNSU12?znG<7AOrcDY( z3GZcB&;75y8CDsw@GJS|JF6GAD|xkz$oI_M{I=iF9`bD{DDW0<&ogtIjlkU$z-dwd zevBqFU5>(1R3y?)G#f1L3yb{>bht zNN}yOEJ2$k_<{F1@644xgMGBmRIoqAk9S!evo1Ce^)Jo#IiytnIcP$29D1d9WQNX< zd!e_}!Ko=33VMw2X21I8V%ZdnM@W(!Y{;otUQa?w7#0|DPN44kRSrgSZQ}B^#@Ksg zCtl|RVd&F_S<+$~aSB(Q?>iAq29L9%!IvaxyZ=+9B^tCTl6y!ngkJr29}Bc;M=KtI z15sv@c>FapnCk#P`C!LX$yzk+zWhf=ZzmA8o8EfG&a5f)OFvQnFFc2yKN0xayN-9L zVdk&hSo3GC4xBSoM~ zDLAjfI^@_NVUj{XNHW7yh$_G;0_CJm`X6Xi){xJ_`DCuNsnaap0>3eMycVXOk$9q503*%-=M%1W@ zEICw!OhYcJLMj9PnTvo34NJ-frBQRL=M^}-_%%Ul2gGnuFd=NN#vu{ZWoI_guDd@T z>^sP4y(3F)JrFh8G@svVzew2JzJnZrup#Pa^@q?iAiedgdh8mH1#uo3jg;U!S*KYE z(8_al-r63g3{PlYNlkfgp9@Yli%W@ftjVp9L)JT9B_fi*-rZCkhfYf0WE!9-xR|&f z@4d+dvu7~7LRe9PaIMgoI5d|7UZ_uoEbsbp{bw|3qp<%UL}LHU19;jT*6;FoDvj!SH7l+xwDLH7s+1-(Lz5s*|U zSfO_a6GFD$^vS_f4(*};^-==Ijtlv>q3IfOu;nS>Qj9P6YlHU53A!q<8TDufSWv%UY$p@(jV9@3`BUPEh3I-_)TKP9J5 z%J^9wLgta1IE_gvQn`K=n#?oy8Is~!$Lem44VH&JbZ#R)p)RN8gBKcyCC1ibP0GBs zd_o%DLFwACE@YTgdmlYKQ2sp(xbz|LFrm&6(jM@}?ZOGtu*L+~P{9&p3=V`{BJ3FgyY;h~xyh3$mGh&W*e z^rI|=zZFgf7@^@t(7x8)u*WiPx-O81Z>Wc3)V1nE`xN)X3!|)kgw1oUs6aa8i}nCX z$j-uQ#AP1(P_D{Ev%lglZpcd$aQS9m)a}HYuGkeYAmq>BO!}}N<}v}e^EHo6MVQ!%TkIe54gMkaGlg)jd5#WAEGB_E+ja~LM%dR zf`+UxEX?w5FZrD|63h;CX^J|legGkg4FvAqzNvTuHY9{xgIw%|@a7Gd(nb0kZQEo{ z-#rDp0*jbLKkk09j&co=x~M$+&Xc`!E0H_XEyay0WiU)N$VEi8pv=b~GdXC~$QLBt z652^dV?&h5R@Hf-lKq_}`yxq{9am}Cg77-_;X)C1qvU{W_aSV1@-!ox!M?3-JR(h_EH1a)&Xa5P}kh-rnk&BO$F)ZzYYv=H` zdhdOcm8wWTU6^-u<8dDPq`I|v^A+nBY{iJ8voUAR8?%yZrg%5bD+UB!U0JmRi^GR% zrHK;c>(xE39cu4HkS9lwC90_WflKM(*pgBjhSlY1Y%jY9pWIbl=)On2Fj=8B6?Fta z*kOBiZIF0xBQz&5<0G8zA~lG=sJH2mJxHGN;oZo#O1|Xv-td|+K0!&>2H$sSHSSJ< zS%9-p0@peY=?W4!aDkO{=5C`*SVBTqh0A>*uQjhM!xuk~fRz#UfWnI+J+5A{GPz&5 zx#D&8XtJo|SFPe#_ge<>azF39cH@6~`rgHi8mS=Rb(1F7foIh>H>dtF>m(ahwo>$* z&21cdJXP^B1M)Wa(*LcpI9w^C%7g8p4(A0V$khntzHK6pZkND&>i?Mns%fH9p1lxx_)R&X?43$9q#lD*; zR1|tc_QeTZHdqgZT-AYN-%jpO%2B_6i0RI}FZ9s*a$AnA8lLjveL~l+cM6q?K6j1-mp)?iZ^dD+W4B4H($;=I|38 z?|$sVlq8gz_s0&ovUsU@;o)KZkD|HL?koP55-e-%7gshX_KSg8D*L|hp=_H@_N`lqZ&7}MbXD8 z2J#1r?hP2EdlZ1X@88*c|0rH+e~4}6b1d6+XhXmM@2_e_(|7KE(07X0eW-pko#)4V zX;_Y3^nKZaEAdXR?qa`833CpjT1Bf5>W&b|mT$`N-F&gyrg+T~^LcZp2|U{+=dhkQ zCpqW1aLb_6H(Dexcl`^yXf2equvw5#;8zhWFB{qTEOL*eYWa%ycg1ZtuNz&1uG&BT EKb)FY9smFU literal 0 HcmV?d00001 diff --git a/client/src/components/Drug/DrugRecord/DrugRecord.tsx b/client/src/components/Drug/DrugRecord/DrugRecord.tsx index 50861c9b..5111102c 100644 --- a/client/src/components/Drug/DrugRecord/DrugRecord.tsx +++ b/client/src/components/Drug/DrugRecord/DrugRecord.tsx @@ -17,11 +17,12 @@ import TableCell from '@mui/material/TableCell'; import Table from '@mui/material/Table'; // components -import { LinearProgress, Link } from '@mui/material'; +import { Alert, LinearProgress, Link } from '@mui/material'; import InteractionTable from 'components/Shared/InteractionTable/InteractionTable'; import { useGetDrugInteractions } from 'hooks/queries/useGetDrugInteractions'; import { generateXrefLink } from 'utils/generateXrefLink'; import { ResultTypes } from 'types/types'; +import { NotFoundError } from 'components/Shared/NotFoundError/NotFoundError'; export const DrugRecord: React.FC = () => { const drugId = useParams().drug as string; @@ -43,6 +44,8 @@ export const DrugRecord: React.FC = () => { setInteractionResults(interactionData); }, [fetchedInteractionData]); + const drugExists = drugData !== null; + const noData = ( No data available. @@ -206,7 +209,7 @@ export const DrugRecord: React.FC = () => { }, ]; - return ( + return drugExists ? ( {drugData?.name} @@ -267,5 +270,12 @@ export const DrugRecord: React.FC = () => { + ) : ( + + + We could not find any results for this drug. + + + ); }; diff --git a/client/src/components/Gene/GeneRecord/GeneRecord.tsx b/client/src/components/Gene/GeneRecord/GeneRecord.tsx index d4650361..0f14bd0d 100644 --- a/client/src/components/Gene/GeneRecord/GeneRecord.tsx +++ b/client/src/components/Gene/GeneRecord/GeneRecord.tsx @@ -15,12 +15,13 @@ import Table from '@mui/material/Table'; import TableRow from '@mui/material/TableRow'; import TableCell from '@mui/material/TableCell'; -import { LinearProgress, Link } from '@mui/material'; +import { Alert, LinearProgress, Link } from '@mui/material'; import { useGetGeneInteractions } from 'hooks/queries/useGetGeneInteractions'; import InteractionTable from 'components/Shared/InteractionTable/InteractionTable'; import { dropRedundantCites } from 'utils/dropRedundantCites'; import { generateXrefLink } from 'utils/generateXrefLink'; import { ResultTypes } from 'types/types'; +import { NotFoundError } from 'components/Shared/NotFoundError/NotFoundError'; export const GeneRecord: React.FC = () => { const geneId: any = useParams().gene; @@ -30,6 +31,8 @@ export const GeneRecord: React.FC = () => { useGetGeneRecord(geneId); const geneData = fetchedGeneData?.gene; + const geneExists = geneData !== null; + // get interaction data const { data: fetchedInteractionData, isLoading: interactionDataIsLoading } = useGetGeneInteractions(geneId); @@ -204,7 +207,7 @@ export const GeneRecord: React.FC = () => { }, ]; - return ( + return geneExists ? ( {geneData?.name} @@ -265,6 +268,13 @@ export const GeneRecord: React.FC = () => { + ) : ( + + + We could not find any results for this gene. + + + ); }; diff --git a/client/src/components/Interaction/InteractionRecord/InteractionRecord.tsx b/client/src/components/Interaction/InteractionRecord/InteractionRecord.tsx index 21196af6..8e2c0a00 100644 --- a/client/src/components/Interaction/InteractionRecord/InteractionRecord.tsx +++ b/client/src/components/Interaction/InteractionRecord/InteractionRecord.tsx @@ -16,10 +16,16 @@ import AccordionDetails from '@mui/material/AccordionDetails'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import ArrowRightIcon from '@mui/icons-material/ArrowRight'; import { truncateDecimals } from 'utils/format'; +import { Alert } from '@mui/material'; +import { NotFoundError } from 'components/Shared/NotFoundError/NotFoundError'; export const InteractionRecord: React.FC = () => { const interactionId = useParams().id; const { data } = useGetInteractionRecord(interactionId!); + const interactionData = data?.interaction; + + const interactionExists = interactionData !== null; + const noData = ( No data available. @@ -38,10 +44,10 @@ export const InteractionRecord: React.FC = () => { - {data?.interaction?.drug?.name} [ - {data?.interaction?.drug?.conceptId}] + {interactionData?.drug?.name} [ + {interactionData?.drug?.conceptId}] @@ -50,10 +56,10 @@ export const InteractionRecord: React.FC = () => { - {data?.interaction?.gene?.name} [ - {data?.interaction?.gene?.conceptId}] + {interactionData?.gene?.name} [ + {interactionData?.gene?.conceptId}] @@ -62,12 +68,12 @@ export const InteractionRecord: React.FC = () => { Interaction Score: - {truncateDecimals(data?.interaction?.interactionScore, 2)} + {truncateDecimals(interactionData?.interactionScore, 2)} - {data?.interaction?.interactionTypes - ? data?.interaction?.interactionTypes?.map((attribute: any) => { + {interactionData?.interactionTypes + ? interactionData?.interactionTypes?.map((attribute: any) => { return ( { - {data?.interaction?.publications.length - ? data?.interaction?.publications?.map( + {interactionData?.publications.length + ? interactionData?.publications?.map( (pmid: any, index: number) => { return ( @@ -123,8 +129,8 @@ export const InteractionRecord: React.FC = () => {
- {data?.interaction?.sources.length - ? data?.interaction?.sources?.map( + {interactionData?.sources.length + ? interactionData?.sources?.map( (source: any, index: number) => { return ( @@ -143,97 +149,102 @@ export const InteractionRecord: React.FC = () => { }, ]; - return ( - data && ( - - - - - {data?.interaction?.drug?.name} - {' '} - {' '} - - {data?.interaction?.gene?.name} - - + return interactionExists ? ( + + + + + {interactionData?.drug?.name} + {' '} + {' '} + + {interactionData?.gene?.name} + - - - {sectionsMap.map((section) => { - return ( - - } - > -

- {section.name} -

-
- - {section.sectionContent} - -
- ); - })} -
- - - } - > -

- Interaction Attributes -

-
- -
- - {data?.interaction?.interactionAttributes.length - ? data?.interaction?.interactionAttributes?.map( - (attribute: any) => { - return ( - - - {attribute.name}: - - - {attribute.value} - - - ); - } - ) - : noData} - -
- - -
+ + + + {sectionsMap.map((section) => { + return ( + + } + > +

+ {section.name} +

+
+ + {section.sectionContent} + +
+ ); + })} +
+ + + } + > +

+ Interaction Attributes +

+
+ + + + {interactionData?.interactionAttributes.length + ? interactionData?.interactionAttributes?.map( + (attribute: any) => { + return ( + + + {attribute.name}: + + + {attribute.value} + + + ); + } + ) + : noData} + +
+
+
- ) + + ) : ( + + + We could not find any results for this interaction. + + + ); }; diff --git a/client/src/components/Layout/MainLayout.scss b/client/src/components/Layout/MainLayout.scss index cc05fcde..754399e2 100644 --- a/client/src/components/Layout/MainLayout.scss +++ b/client/src/components/Layout/MainLayout.scss @@ -18,6 +18,7 @@ body { background-color: var(--background-light); color: var(--text-content); min-height: 100vh; + position: relative; .content-container { background-color: var(--background-light); @@ -25,10 +26,13 @@ body { flex-direction: column; align-items: stretch; padding: 20px; + padding-bottom: 75px; + min-height: 100%; } .content { background-color: var(--background); + min-height: 75vh; } } @@ -117,6 +121,8 @@ footer { font-size: 20px; font-family: 'Work Sans'; font-weight: 300; + position: absolute; + bottom: 0; } .ant-tabs { diff --git a/client/src/components/Shared/NotFoundError/NotFoundError.scss b/client/src/components/Shared/NotFoundError/NotFoundError.scss new file mode 100644 index 00000000..ced501cd --- /dev/null +++ b/client/src/components/Shared/NotFoundError/NotFoundError.scss @@ -0,0 +1,7 @@ +.not-found-404 { + object-fit: contain; + height: 50%; + width: 50%; + margin: auto; + margin-top: 50px; +} diff --git a/client/src/components/Shared/NotFoundError/NotFoundError.tsx b/client/src/components/Shared/NotFoundError/NotFoundError.tsx new file mode 100644 index 00000000..3b53952a --- /dev/null +++ b/client/src/components/Shared/NotFoundError/NotFoundError.tsx @@ -0,0 +1,14 @@ +import { Box } from '@mui/material'; +import './NotFoundError.scss'; + +export const NotFoundError: React.FC = () => { + return ( + + 404 error + + ); +}; diff --git a/client/src/components/Shared/ReleaseInformation/ReleaseInformation.scss b/client/src/components/Shared/ReleaseInformation/ReleaseInformation.scss index cb4174c8..c31e736f 100644 --- a/client/src/components/Shared/ReleaseInformation/ReleaseInformation.scss +++ b/client/src/components/Shared/ReleaseInformation/ReleaseInformation.scss @@ -5,4 +5,4 @@ color: white; text-decoration: underline; } -} \ No newline at end of file +} From 60a1809d1feb7f42f0c89721e91d44a1a4a85d19 Mon Sep 17 00:00:00 2001 From: Adam Coffman Date: Tue, 12 Dec 2023 11:30:16 -0600 Subject: [PATCH 03/25] add public/data as shared, linked dir --- server/config/deploy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/config/deploy.rb b/server/config/deploy.rb index 1b993f90..061c5d52 100644 --- a/server/config/deploy.rb +++ b/server/config/deploy.rb @@ -11,7 +11,7 @@ set :rbenv_type, :user -set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads', 'storage') +set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads', 'public/data', 'storage') set :linked_files, fetch(:linked_files, []).push('config/master.key') set :repo_tree, 'server' From d24f99c0d5c8ab40386ef955c841b473e8502478 Mon Sep 17 00:00:00 2001 From: Matthew Cannon <87494086+mcannon068nw@users.noreply.github.com> Date: Tue, 12 Dec 2023 13:12:32 -0500 Subject: [PATCH 04/25] Update dgidb:load_local method (#463) * update file download location for dgidb_v5_latest in load_local methods * update download instructions with rake dgidb:load_local method * removed psql command in favor of just dgidb:load_local * fix spacing issue * prettier --- client/src/pages/Downloads/Info/Info.tsx | 15 ++++----------- server/lib/tasks/db_bootstrapping.rake | 2 +- server/lib/utils/snapshot_helpers.rb | 2 +- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/client/src/pages/Downloads/Info/Info.tsx b/client/src/pages/Downloads/Info/Info.tsx index d472de4f..615b507e 100644 --- a/client/src/pages/Downloads/Info/Info.tsx +++ b/client/src/pages/Downloads/Info/Info.tsx @@ -11,19 +11,12 @@ export const Info = () => { information for each source.

- You may load the{' '} - - latest data dump - {' '} - into your local database instance by running the following command while - in your local checkout of the DGIdb repository: + You may instantiate your local database instance by running the + following command while in the 'server' directory of your local checkout + of the DGIdb repository:

- psql -d dgidb -f dgidb_v5_latest.sql + rake dgidb:load_local

This will recreate the local database and import the latest data dump diff --git a/server/lib/tasks/db_bootstrapping.rake b/server/lib/tasks/db_bootstrapping.rake index 93cf26a0..0919208c 100644 --- a/server/lib/tasks/db_bootstrapping.rake +++ b/server/lib/tasks/db_bootstrapping.rake @@ -9,7 +9,7 @@ namespace :dgidb do else data_submodule_path = File.join(Rails.root, 'data') end - data_file = File.join(data_submodule_path, 'data.sql') + data_file = File.join(data_submodule_path, 'dgidb_v5_latest.sql') version_file = File.join(Rails.root, 'VERSION') database_name = Rails.configuration.database_configuration[Rails.env]['database'] host = Rails.configuration.database_configuration[Rails.env]['host'] diff --git a/server/lib/utils/snapshot_helpers.rb b/server/lib/utils/snapshot_helpers.rb index e27ef89b..68650bb6 100644 --- a/server/lib/utils/snapshot_helpers.rb +++ b/server/lib/utils/snapshot_helpers.rb @@ -52,7 +52,7 @@ def download_data_dump(destination) unless Dir.exist? 'data' Dir.mkdir('data') end - system_or_die("wget -O #{destination} http://dgidb.org/data/data.sql") + system_or_die("wget -O #{destination} https://nch-igm-wagner-lab-public.s3.us-east-2.amazonaws.com/dgidb_v5_latest.sql") end private From 5afdf8c229c8fae298b700324bd9b074079c23c9 Mon Sep 17 00:00:00 2001 From: Adam Coffman Date: Tue, 12 Dec 2023 13:09:31 -0600 Subject: [PATCH 05/25] add December 2023 download links --- client/src/pages/Downloads/Files/Files.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/src/pages/Downloads/Files/Files.tsx b/client/src/pages/Downloads/Files/Files.tsx index 2183c318..3ef48c19 100644 --- a/client/src/pages/Downloads/Files/Files.tsx +++ b/client/src/pages/Downloads/Files/Files.tsx @@ -24,6 +24,13 @@ function createData( } const rows = [ + createData( + '2023-Dec', + 'interactions.tsv', + 'genes.tsv', + 'drugs.tsv', + 'categories.tsv' + ), createData( '2022-Feb', 'interactions.tsv', From 09ffb157ffce084bb4390fede1806c12e79280a6 Mon Sep 17 00:00:00 2001 From: katiestahl Date: Thu, 14 Dec 2023 18:03:57 +0000 Subject: [PATCH 06/25] Automated frontend build --- server/public/index.html | 2 +- server/public/static/js/main.e4ddf370.js | 3 - .../static/js/main.e4ddf370.js.LICENSE.txt | 123 ------------------ server/public/static/js/main.e4ddf370.js.map | 1 - 4 files changed, 1 insertion(+), 128 deletions(-) delete mode 100644 server/public/static/js/main.e4ddf370.js delete mode 100644 server/public/static/js/main.e4ddf370.js.LICENSE.txt delete mode 100644 server/public/static/js/main.e4ddf370.js.map diff --git a/server/public/index.html b/server/public/index.html index da471895..2425467a 100644 --- a/server/public/index.html +++ b/server/public/index.html @@ -1 +1 @@ -DGIdb

+DGIdb
\ No newline at end of file diff --git a/server/public/static/js/main.e4ddf370.js b/server/public/static/js/main.e4ddf370.js deleted file mode 100644 index 568129e2..00000000 --- a/server/public/static/js/main.e4ddf370.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! For license information please see main.e4ddf370.js.LICENSE.txt */ -!function(){var e={4322:function(e,t,n){e.exports=n(6652)},9299:function(e,t,n){"use strict";n.d(t,{Z:function(){return ie}});var r=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?c(x,--b):0,m--,10===y&&(m=1,v--),y}function E(){return y=b2||I(y)>3?"":" "}function P(e,t){for(;--t&&E()&&!(y<48||y>102||y>57&&y<65||y>70&&y<97););return _(e,T()+(t<6&&32==S()&&32==E()))}function D(e){for(;E();)switch(y){case e:return b;case 34:case 39:34!==e&&39!==e&&D(y);break;case 40:41===e&&D(e);break;case 92:E()}return b}function A(e,t){for(;E()&&e+y!==57&&(e+y!==84||47!==S()););return"/*"+_(t,b-1)+"*"+o(47===e?e:E())}function Z(e){for(;!I(S());)E();return _(e,b)}var j="-ms-",L="-moz-",F="-webkit-",z="comm",B="rule",V="decl",H="@keyframes";function U(e,t){for(var n="",r=p(e),i=0;i0&&f(L)-g&&h(y>32?Q(L+";",r,n,g-1):Q(s(L," ","")+";",r,n,g-2),p);break;case 59:L+=";";default:if(h(j=K(L,t,n,v,m,i,d,R,N=[],D=[],g),a),123===I)if(0===m)G(L,t,j,j,N,a,g,d,D);else switch(99===b&&110===c(L,3)?100:b){case 100:case 109:case 115:G(e,j,j,r&&h(K(e,j,j,0,0,i,d,R,i,N=[],g),D),i,D,g,d,r?N:D);break;default:G(L,j,j,j,[""],D,0,d,D)}}v=m=y=0,w=_=1,R=L="",g=l;break;case 58:g=1+f(L),y=x;default:if(w<1)if(123==I)--w;else if(125==I&&0==w++&&125==k())continue;switch(L+=o(I),I*w){case 38:_=m>0?1:(L+="\f",-1);break;case 44:d[v++]=(f(L)-1)*_,_=1;break;case 64:45===S()&&(L+=O(E())),b=S(),m=g=f(R=L+=Z(T())),I++;break;case 45:45===x&&2==f(L)&&(w=0)}}return a}function K(e,t,n,r,o,a,u,c,f,h,v){for(var m=o-1,g=0===o?a:[""],b=p(g),y=0,x=0,C=0;y0?g[k]+" "+E:s(E,/&\f/g,g[k])))&&(f[C++]=S);return w(e,t,n,0===o?B:c,f,h,v)}function $(e,t,n){return w(e,t,n,z,o(y),d(e,2,-2),0)}function Q(e,t,n,r){return w(e,t,n,V,d(e,0,r),d(e,r+1,-1),r)}var Y=function(e,t,n){for(var r=0,i=0;r=i,i=S(),38===r&&12===i&&(t[n]=1),!I(i);)E();return _(e,b)},J=function(e,t){return N(function(e,t){var n=-1,r=44;do{switch(I(r)){case 0:38===r&&12===S()&&(t[n]=1),e[n]+=Y(b-1,t,n);break;case 2:e[n]+=O(r);break;case 4:if(44===r){e[++n]=58===S()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=o(r)}}while(r=E());return e}(R(e),t))},X=new WeakMap,ee=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||X.get(n))&&!r){X.set(e,!0);for(var i=[],o=J(t,i),a=n.props,l=0,s=0;l6)switch(c(e,t+1)){case 109:if(45!==c(e,t+4))break;case 102:return s(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1-moz-"+(108==c(e,t+3)?"$3":"$2-$3"))+e;case 115:return~u(e,"stretch")?ne(s(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==c(e,t+1))break;case 6444:switch(c(e,f(e)-3-(~u(e,"!important")&&10))){case 107:return s(e,":",":-webkit-")+e;case 101:return s(e,/(.+:)([^;!]+)(;|!.+)?/,"$1-webkit-"+(45===c(e,14)?"inline-":"")+"box$3$1"+"-webkit-$2$3$1"+"-ms-$2box$3")+e}break;case 5936:switch(c(e,t+11)){case 114:return F+e+j+s(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return F+e+j+s(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return F+e+j+s(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return F+e+j+e+e}return e}var re=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case V:e.return=ne(e.value,e.length);break;case H:return U([C(e,{value:s(e.value,"@","@-webkit-")})],r);case B:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return U([C(e,{props:[s(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return U([C(e,{props:[s(t,/:(plac\w+)/,":-webkit-input-$1")]}),C(e,{props:[s(t,/:(plac\w+)/,":-moz-$1")]}),C(e,{props:[s(t,/:(plac\w+)/,"-ms-input-$1")]})],r)}return""}))}}],ie=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var i=e.stylisPlugins||re;var o,a,l={},s=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},i={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},o=n(1827),a=/[A-Z]|^ms/g,l=/_EMO_([^_]+?)_([^]*?)_EMO_/g,s=function(e){return 45===e.charCodeAt(1)},u=function(e){return null!=e&&"boolean"!==typeof e},c=(0,o.Z)((function(e){return s(e)?e:e.replace(a,"-$&").toLowerCase()})),d=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(l,(function(e,t,n){return p={name:t,styles:n,next:p},t}))}return 1===i[e]||s(e)||"number"!==typeof t||0===t?t:t+"px"};function f(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return p={name:n.name,styles:n.styles,next:p},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)p={name:r.name,styles:r.styles,next:p},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i2&&void 0!==arguments[2]?arguments[2]:null;(0,c.Z)(this,e),this.key=t,this.storage=n,this.maxSize=r,this.items=this.fetchAll()}return(0,d.Z)(e,[{key:"length",get:function(){return this.items.length}},{key:"contains",value:function(e){return this.items.some((function(t){return t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName}))}},{key:"edit",value:function(e){var t=this.items.findIndex((function(t){return t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName}));-1!==t&&(this.items.splice(t,1,e),this.save())}},{key:"delete",value:function(e){var t=this.items.findIndex((function(t){return t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName}));-1!==t&&(this.items.splice(t,1),this.save())}},{key:"fetchRecent",value:function(){return this.items.at(-1)}},{key:"fetchAll",value:function(){var e=this.storage.get(this.key);return e?JSON.parse(e)[this.key]:[]}},{key:"push",value:function(e){var t=[].concat((0,f.Z)(this.items),[e]);this.maxSize&&t.length>this.maxSize&&t.shift();for(var n=0;n<5;n++){var r=this.storage.set(this.key,JSON.stringify((0,u.Z)({},this.key,t)));if(null===r||void 0===r?void 0:r.error){if(!r.isQuotaError||!this.maxSize)return;t.shift()}else this.items=t}}},{key:"save",value:function(){this.storage.set(this.key,JSON.stringify((0,u.Z)({},this.key,this.items)))}}]),e}();ie(Pe,"QueryStore");var De=function(){function e(t,n){var r=this;(0,c.Z)(this,e),this.storage=t,this.maxHistoryLength=n,this.updateHistory=function(e,t,n,i){if(r.shouldSaveQuery(e,t,n,r.history.fetchRecent())){r.history.push({query:e,variables:t,headers:n,operationName:i});var o=r.history.items,a=r.favorite.items;r.queries=o.concat(a)}},this.history=new Pe("queries",this.storage,this.maxHistoryLength),this.favorite=new Pe("favorites",this.storage,null),this.queries=[].concat((0,f.Z)(this.history.fetchAll()),(0,f.Z)(this.favorite.fetchAll()))}return(0,d.Z)(e,[{key:"shouldSaveQuery",value:function(e,t,n,r){if(!e)return!1;try{(0,k.Qc)(e)}catch(i){return!1}if(e.length>1e5)return!1;if(!r)return!0;if(JSON.stringify(e)===JSON.stringify(r.query)){if(JSON.stringify(t)===JSON.stringify(r.variables)){if(JSON.stringify(n)===JSON.stringify(r.headers))return!1;if(n&&!r.headers)return!1}if(t&&!r.variables)return!1}return!0}},{key:"toggleFavorite",value:function(e,t,n,r,i,o){var a={query:e,variables:t,headers:n,operationName:r,label:i};this.favorite.contains(a)?o&&(a.favorite=!1,this.favorite.delete(a)):(a.favorite=!0,this.favorite.push(a)),this.queries=[].concat((0,f.Z)(this.history.items),(0,f.Z)(this.favorite.items))}},{key:"editLabel",value:function(e,t,n,r,i,o){var a={query:e,variables:t,headers:n,operationName:r,label:i};o?this.favorite.edit(Object.assign(Object.assign({},a),{favorite:o})):this.history.edit(a),this.queries=[].concat((0,f.Z)(this.history.items),(0,f.Z)(this.favorite.items))}}]),e}();ie(De,"HistoryStore");var Ae=Object.defineProperty,Ze=ie((function(e,t){return Ae(e,"name",{value:t,configurable:!0})}),"__name$G");function je(e){var t=(0,g.createContext)(null);return t.displayName=e,t}function Le(e){function t(n){var r,i=(0,g.useContext)(e);if(null===i&&(null==n?void 0:n.nonNull))throw new Error("Tried to use `".concat((null==(r=n.caller)?void 0:r.name)||t.caller.name,"` without the necessary context. Make sure to render the `").concat(e.displayName,"Provider` component higher up the tree."));return i}return ie(t,"useGivenContext"),Ze(t,"useGivenContext"),Object.defineProperty(t,"name",{value:"use".concat(e.displayName)}),t}ie(je,"createNullableContext"),Ze(je,"createNullableContext"),ie(Le,"createContextHook"),Ze(Le,"createContextHook");var Fe="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof n.g?n.g:"undefined"!==typeof self?self:{};function ze(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Be(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}ie(ze,"getDefaultExportFromCjs"),ie(Be,"getAugmentedNamespace");var Ve={exports:{}},He={};Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function Ue(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function qe(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}ie(Ue,"toObject"),ie(qe,"shouldUseNative"),qe()&&Object.assign;var We=g,Ge=60103;if(He.Fragment=60107,"function"===typeof Symbol&&Symbol.for){var Ke=Symbol.for;Ge=Ke("react.element"),He.Fragment=Ke("react.fragment")}var $e=We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Qe=Object.prototype.hasOwnProperty,Ye={key:!0,ref:!0,__self:!0,__source:!0};function Je(e,t,n){var r,i={},o=null,a=null;for(r in void 0!==n&&(o=""+n),void 0!==t.key&&(o=""+t.key),void 0!==t.ref&&(a=t.ref),t)Qe.call(t,r)&&!Ye.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:Ge,type:e,key:o,ref:a,props:i,_owner:$e.current}}ie(Je,"q$1"),He.jsx=Je,He.jsxs=Je,Ve.exports=He;var Xe=Ve.exports.jsx,et=Ve.exports.jsxs,tt=Ve.exports.Fragment,nt=Object.defineProperty,rt=ie((function(e,t){return nt(e,"name",{value:t,configurable:!0})}),"__name$F"),it=je("StorageContext");function ot(e){var t=(0,g.useRef)(!0),n=(0,g.useState)(new Oe(e.storage)),r=(0,s.Z)(n,2),i=r[0],o=r[1];return(0,g.useEffect)((function(){t.current?t.current=!1:o(new Oe(e.storage))}),[e.storage]),Xe(it.Provider,{value:i,children:e.children})}ie(ot,"StorageContextProvider"),rt(ot,"StorageContextProvider");var at,lt,st=Le(it);function ut(e){return ct(e,[])}function ct(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return dt(e,t);default:return String(e)}}function dt(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";var n=[].concat((0,f.Z)(t),[e]);if(ft(e)){var r=e.toJSON();if(r!==e)return"string"===typeof r?r:ct(r,n)}else if(Array.isArray(e))return ht(e,n);return pt(e,n)}function ft(e){return"function"===typeof e.toJSON}function pt(e,t){var n=Object.entries(e);return 0===n.length?"{}":t.length>2?"["+vt(e)+"]":"{ "+n.map((function(e){var n=(0,s.Z)(e,2);return n[0]+": "+ct(n[1],t)})).join(", ")+" }"}function ht(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var n=Math.min(10,e.length),r=e.length-n,i=[],o=0;o1&&i.push("... ".concat(r," more items")),"["+i.join(", ")+"]"}function vt(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"===typeof e.constructor){var n=e.constructor.name;if("string"===typeof n&&""!==n)return n}return t}function mt(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}function gt(e){return 9===e||32===e}function bt(e){return e>=48&&e<=57}function yt(e){return e>=97&&e<=122||e>=65&&e<=90}function xt(e){return yt(e)||95===e}function wt(e){return yt(e)||bt(e)||95===e}function Ct(e,t){var n=e.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=1===r.length,o=r.length>1&&r.slice(1).every((function(e){return 0===e.length||gt(e.charCodeAt(0))})),a=n.endsWith('\\"""'),l=e.endsWith('"')&&!a,s=e.endsWith("\\"),u=l||s,c=!(null!==t&&void 0!==t&&t.minimize)&&(!i||e.length>70||u||o||a),d="",f=i&>(e.charCodeAt(0));return(c&&!f||o)&&(d+="\n"),d+=n,(c||u)&&(d+="\n"),'"""'+d+'"""'}function kt(e){return'"'.concat(e.replace(Et,St),'"')}ie(ut,"inspect"),ie(ct,"formatValue"),ie(dt,"formatObjectValue"),ie(ft,"isJSONable"),ie(pt,"formatObject"),ie(ht,"formatArray"),ie(vt,"getObjectTag"),ie(mt,"invariant"),(lt=at||(at={})).QUERY="QUERY",lt.MUTATION="MUTATION",lt.SUBSCRIPTION="SUBSCRIPTION",lt.FIELD="FIELD",lt.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",lt.FRAGMENT_SPREAD="FRAGMENT_SPREAD",lt.INLINE_FRAGMENT="INLINE_FRAGMENT",lt.VARIABLE_DEFINITION="VARIABLE_DEFINITION",lt.SCHEMA="SCHEMA",lt.SCALAR="SCALAR",lt.OBJECT="OBJECT",lt.FIELD_DEFINITION="FIELD_DEFINITION",lt.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",lt.INTERFACE="INTERFACE",lt.UNION="UNION",lt.ENUM="ENUM",lt.ENUM_VALUE="ENUM_VALUE",lt.INPUT_OBJECT="INPUT_OBJECT",lt.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION",ie(gt,"isWhiteSpace$2"),ie(bt,"isDigit$1"),ie(yt,"isLetter$1"),ie(xt,"isNameStart"),ie(wt,"isNameContinue"),ie(Ct,"printBlockString"),ie(kt,"printString");var Et=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function St(e){return Tt[e.charCodeAt(0)]}ie(St,"escapedReplacer");var Tt=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];function _t(e,t){if(!Boolean(e))throw new Error(t)}ie(_t,"devAssert");var It,Rt,Nt,Ot,Mt={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Pt=new Set(Object.keys(Mt));function Dt(e){var t=null===e||void 0===e?void 0:e.kind;return"string"===typeof t&&Pt.has(t)}ie(Dt,"isNode"),(Rt=It||(It={})).QUERY="query",Rt.MUTATION="mutation",Rt.SUBSCRIPTION="subscription",(Ot=Nt||(Nt={})).NAME="Name",Ot.DOCUMENT="Document",Ot.OPERATION_DEFINITION="OperationDefinition",Ot.VARIABLE_DEFINITION="VariableDefinition",Ot.SELECTION_SET="SelectionSet",Ot.FIELD="Field",Ot.ARGUMENT="Argument",Ot.FRAGMENT_SPREAD="FragmentSpread",Ot.INLINE_FRAGMENT="InlineFragment",Ot.FRAGMENT_DEFINITION="FragmentDefinition",Ot.VARIABLE="Variable",Ot.INT="IntValue",Ot.FLOAT="FloatValue",Ot.STRING="StringValue",Ot.BOOLEAN="BooleanValue",Ot.NULL="NullValue",Ot.ENUM="EnumValue",Ot.LIST="ListValue",Ot.OBJECT="ObjectValue",Ot.OBJECT_FIELD="ObjectField",Ot.DIRECTIVE="Directive",Ot.NAMED_TYPE="NamedType",Ot.LIST_TYPE="ListType",Ot.NON_NULL_TYPE="NonNullType",Ot.SCHEMA_DEFINITION="SchemaDefinition",Ot.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",Ot.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",Ot.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",Ot.FIELD_DEFINITION="FieldDefinition",Ot.INPUT_VALUE_DEFINITION="InputValueDefinition",Ot.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",Ot.UNION_TYPE_DEFINITION="UnionTypeDefinition",Ot.ENUM_TYPE_DEFINITION="EnumTypeDefinition",Ot.ENUM_VALUE_DEFINITION="EnumValueDefinition",Ot.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",Ot.DIRECTIVE_DEFINITION="DirectiveDefinition",Ot.SCHEMA_EXTENSION="SchemaExtension",Ot.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",Ot.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",Ot.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",Ot.UNION_TYPE_EXTENSION="UnionTypeExtension",Ot.ENUM_TYPE_EXTENSION="EnumTypeExtension",Ot.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension";var At=Object.freeze({});function Zt(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mt,r=new Map,i=0,o=Object.values(Nt);i80&&(l=a+Vt("(\n",Ht(zt(r,"\n")),"\n)")),zt([l,zt(i," "),o]," ")}},Argument:{leave:function(e){return e.name+": "+e.value}},FragmentSpread:{leave:function(e){return"..."+e.name+Vt(" ",zt(e.directives," "))}},InlineFragment:{leave:function(e){var t=e.typeCondition,n=e.directives,r=e.selectionSet;return zt(["...",Vt("on ",t),zt(n," "),r]," ")}},FragmentDefinition:{leave:function(e){var t=e.name,n=e.typeCondition,r=e.variableDefinitions,i=e.directives,o=e.selectionSet;return"fragment ".concat(t).concat(Vt("(",zt(r,", "),")")," on ").concat(n," ").concat(Vt("",zt(i," ")," "))+o}},IntValue:{leave:function(e){return e.value}},FloatValue:{leave:function(e){return e.value}},StringValue:{leave:function(e){var t=e.value;return e.block?Ct(t):kt(t)}},BooleanValue:{leave:function(e){return e.value?"true":"false"}},NullValue:{leave:function(){return"null"}},EnumValue:{leave:function(e){return e.value}},ListValue:{leave:function(e){return"["+zt(e.values,", ")+"]"}},ObjectValue:{leave:function(e){return"{"+zt(e.fields,", ")+"}"}},ObjectField:{leave:function(e){return e.name+": "+e.value}},Directive:{leave:function(e){return"@"+e.name+Vt("(",zt(e.arguments,", "),")")}},NamedType:{leave:function(e){return e.name}},ListType:{leave:function(e){return"["+e.type+"]"}},NonNullType:{leave:function(e){return e.type+"!"}},SchemaDefinition:{leave:function(e){var t=e.description,n=e.directives,r=e.operationTypes;return Vt("",t,"\n")+zt(["schema",zt(n," "),Bt(r)]," ")}},OperationTypeDefinition:{leave:function(e){return e.operation+": "+e.type}},ScalarTypeDefinition:{leave:function(e){var t=e.description,n=e.name,r=e.directives;return Vt("",t,"\n")+zt(["scalar",n,zt(r," ")]," ")}},ObjectTypeDefinition:{leave:function(e){var t=e.description,n=e.name,r=e.interfaces,i=e.directives,o=e.fields;return Vt("",t,"\n")+zt(["type",n,Vt("implements ",zt(r," & ")),zt(i," "),Bt(o)]," ")}},FieldDefinition:{leave:function(e){var t=e.description,n=e.name,r=e.arguments,i=e.type,o=e.directives;return Vt("",t,"\n")+n+(Ut(r)?Vt("(\n",Ht(zt(r,"\n")),"\n)"):Vt("(",zt(r,", "),")"))+": "+i+Vt(" ",zt(o," "))}},InputValueDefinition:{leave:function(e){var t=e.description,n=e.name,r=e.type,i=e.defaultValue,o=e.directives;return Vt("",t,"\n")+zt([n+": "+r,Vt("= ",i),zt(o," ")]," ")}},InterfaceTypeDefinition:{leave:function(e){var t=e.description,n=e.name,r=e.interfaces,i=e.directives,o=e.fields;return Vt("",t,"\n")+zt(["interface",n,Vt("implements ",zt(r," & ")),zt(i," "),Bt(o)]," ")}},UnionTypeDefinition:{leave:function(e){var t=e.description,n=e.name,r=e.directives,i=e.types;return Vt("",t,"\n")+zt(["union",n,zt(r," "),Vt("= ",zt(i," | "))]," ")}},EnumTypeDefinition:{leave:function(e){var t=e.description,n=e.name,r=e.directives,i=e.values;return Vt("",t,"\n")+zt(["enum",n,zt(r," "),Bt(i)]," ")}},EnumValueDefinition:{leave:function(e){var t=e.description,n=e.name,r=e.directives;return Vt("",t,"\n")+zt([n,zt(r," ")]," ")}},InputObjectTypeDefinition:{leave:function(e){var t=e.description,n=e.name,r=e.directives,i=e.fields;return Vt("",t,"\n")+zt(["input",n,zt(r," "),Bt(i)]," ")}},DirectiveDefinition:{leave:function(e){var t=e.description,n=e.name,r=e.arguments,i=e.repeatable,o=e.locations;return Vt("",t,"\n")+"directive @"+n+(Ut(r)?Vt("(\n",Ht(zt(r,"\n")),"\n)"):Vt("(",zt(r,", "),")"))+(i?" repeatable":"")+" on "+zt(o," | ")}},SchemaExtension:{leave:function(e){var t=e.directives,n=e.operationTypes;return zt(["extend schema",zt(t," "),Bt(n)]," ")}},ScalarTypeExtension:{leave:function(e){return zt(["extend scalar",e.name,zt(e.directives," ")]," ")}},ObjectTypeExtension:{leave:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return zt(["extend type",t,Vt("implements ",zt(n," & ")),zt(r," "),Bt(i)]," ")}},InterfaceTypeExtension:{leave:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return zt(["extend interface",t,Vt("implements ",zt(n," & ")),zt(r," "),Bt(i)]," ")}},UnionTypeExtension:{leave:function(e){var t=e.name,n=e.directives,r=e.types;return zt(["extend union",t,zt(n," "),Vt("= ",zt(r," | "))]," ")}},EnumTypeExtension:{leave:function(e){var t=e.name,n=e.directives,r=e.values;return zt(["extend enum",t,zt(n," "),Bt(r)]," ")}},InputObjectTypeExtension:{leave:function(e){var t=e.name,n=e.directives,r=e.fields;return zt(["extend input",t,zt(n," "),Bt(r)]," ")}}};function zt(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null===e||void 0===e?void 0:e.filter((function(e){return e})).join(n))&&void 0!==t?t:""}function Bt(e){return Vt("{\n",Ht(zt(e,"\n")),"\n}")}function Vt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+n:""}function Ht(e){return Vt(" ",e.replace(/\n/g,"\n "))}function Ut(e){var t;return null!==(t=null===e||void 0===e?void 0:e.some((function(e){return e.includes("\n")})))&&void 0!==t&&t}function qt(e){return"object"===typeof e&&"function"===typeof(null===e||void 0===e?void 0:e[Symbol.iterator])}function Wt(e){return"object"==typeof e&&null!==e}ie(zt,"join"),ie(Bt,"block$2"),ie(Vt,"wrap"),ie(Ht,"indent"),ie(Ut,"hasMultilineItems"),ie(qt,"isIterableObject"),ie(Wt,"isObjectLike");function Gt(e,t){var n=t?[e,t]:[void 0,e],r=(0,s.Z)(n,2),i=r[0],o=" Did you mean ";i&&(o+=i+" ");var a=r[1].map((function(e){return'"'.concat(e,'"')}));switch(a.length){case 0:return"";case 1:return o+a[0]+"?";case 2:return o+a[0]+" or "+a[1]+"?"}var l=a.slice(0,5),u=l.pop();return o+l.join(", ")+", or "+u+"?"}function Kt(e){return e}ie(Gt,"didYouMean"),ie(Kt,"identityFunc");var $t=ie((function(e,t){return e instanceof t}),"instanceOf");function Qt(e,t){var n,r=Object.create(null),i=(0,p.Z)(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;r[t(o)]=o}}catch(a){i.e(a)}finally{i.f()}return r}function Yt(e,t,n){var r,i=Object.create(null),o=(0,p.Z)(e);try{for(o.s();!(r=o.n()).done;){var a=r.value;i[t(a)]=n(a)}}catch(l){o.e(l)}finally{o.f()}return i}function Jt(e,t){for(var n=Object.create(null),r=0,i=Object.keys(e);r0);var l=0;do{++r,l=10*l+o-en,o=t.charCodeAt(r)}while(tn(o)&&l>0);if(al)return 1}else{if(io)return 1;++n,++r}}return e.length-t.length}ie(Qt,"keyMap"),ie(Yt,"keyValMap"),ie(Jt,"mapValue"),ie(Xt,"naturalCompare");var en=48;function tn(e){return!isNaN(e)&&en<=e&&e<=57}function nn(e,t){var n,r=Object.create(null),i=new rn(e),o=Math.floor(.4*e.length)+1,a=(0,p.Z)(t);try{for(a.s();!(n=a.n()).done;){var l=n.value,s=i.measure(l,o);void 0!==s&&(r[l]=s)}}catch(u){a.e(u)}finally{a.f()}return Object.keys(r).sort((function(e,t){var n=r[e]-r[t];return 0!==n?n:Xt(e,t)}))}ie(tn,"isDigit"),ie(nn,"suggestionList");var rn=function(){function e(t){(0,c.Z)(this,e),this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=on(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}return(0,d.Z)(e,[{key:"measure",value:function(e,t){if(this._input===e)return 0;var n=e.toLowerCase();if(this._inputLowerCase===n)return 1;var r=on(n),i=this._inputArray;if(r.lengtht)){for(var s=this._rows,u=0;u<=l;u++)s[0][u]=u;for(var c=1;c<=a;c++){for(var d=s[(c-1)%3],f=s[c%3],p=f[0]=c,h=1;h<=l;h++){var v=r[c-1]===i[h-1]?0:1,m=Math.min(d[h]+1,f[h-1]+1,d[h-1]+v);if(c>1&&h>1&&r[c-1]===i[h-2]&&r[c-2]===i[h-1]){var g=s[(c-2)%3][h-2];m=Math.min(m,g+1)}mt)return}var b=s[a%3][l];return b<=t?b:void 0}}}]),e}();function on(e){for(var t=e.length,n=new Array(t),r=0;r=t)break;r=a.index+a[0].length,i+=1}}catch(l){o.e(l)}finally{o.f()}return{line:i,column:t+1-r}}function un(e){return cn(e.source,sn(e.source,e.start))}function cn(e,t){var n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,l=1===t.line?n:0,s=t.column+l,u="".concat(e.name,":").concat(a,":").concat(s,"\n"),c=r.split(/\r\n|[\n\r]/g),d=c[i];if(d.length>120){for(var p=Math.floor(s/80),h=s%80,v=[],m=0;m1?s-1:0),d=1;d0&&(e.extensions=this.extensions),e}}]),r}((0,l.Z)(Error),Symbol.toStringTag);function hn(e){return void 0===e||0===e.length?void 0:e}function vn(e,t){switch(e.kind){case Nt.NULL:return null;case Nt.INT:return parseInt(e.value,10);case Nt.FLOAT:return parseFloat(e.value);case Nt.STRING:case Nt.ENUM:case Nt.BOOLEAN:return e.value;case Nt.LIST:return e.values.map((function(e){return vn(e,t)}));case Nt.OBJECT:return Yt(e.fields,(function(e){return e.name.value}),(function(e){return vn(e.value,t)}));case Nt.VARIABLE:return null===t||void 0===t?void 0:t[e.name.value]}}function mn(e){if(null!=e||_t(!1,"Must provide name."),"string"===typeof e||_t(!1,"Expected name to be a string."),0===e.length)throw new pn("Expected name to be a non-empty string.");for(var t=1;tQn||nQn||eQn||t=0;i--)t(n[i])}function Xr(e){for(var t=Object.keys(e),n=t.length,r=new Array(n),i=0;it.length&&(n-=e.length-t.length-1,n+=0===e.indexOf(t)?0:.5),n}function oi(e,t){var n,r,i=[],o=e.length,a=t.length;for(n=0;n<=o;n++)i[n]=[n];for(r=1;r<=a;r++)i[0][r]=r;for(n=1;n<=o;n++)for(r=1;r<=a;r++){var l=e[n-1]===t[r-1]?0:1;i[n][r]=Math.min(i[n-1][r]+1,i[n][r-1]+1,i[n-1][r-1]+l),n>1&&r>1&&e[n-1]===t[r-2]&&e[n-2]===t[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+l))}return i[o][a]}Object.freeze([sr,ur,cr,dr,fr,pr,hr,Wr]),ie(Qr,"getDefinitionState"),ie(Yr,"getFieldDef"),ie(Jr,"forEachState"),ie(Xr,"objectValues"),ie(ei,"hintList"),ie(ti,"filterAndSortList"),ie(ni,"filterNonEmpty"),ie(ri,"normalizeText"),ie(ii,"getProximity"),ie(oi,"lexicalDistance"),function(e){function t(e){return"string"===typeof e}ie(t,"is"),e.is=t}(vr||(vr={})),function(e){function t(e){return"string"===typeof e}ie(t,"is"),e.is=t}(mr||(mr={})),function(e){function t(t){return"number"===typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647,ie(t,"is"),e.is=t}(gr||(gr={})),function(e){function t(t){return"number"===typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}e.MIN_VALUE=0,e.MAX_VALUE=2147483647,ie(t,"is"),e.is=t}(br||(br={})),function(e){function t(e,t){return e===Number.MAX_VALUE&&(e=br.MAX_VALUE),t===Number.MAX_VALUE&&(t=br.MAX_VALUE),{line:e,character:t}}function n(e){var t=e;return so.objectLiteral(t)&&so.uinteger(t.line)&&so.uinteger(t.character)}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(yr||(yr={})),function(e){function t(e,t,n,r){if(so.uinteger(e)&&so.uinteger(t)&&so.uinteger(n)&&so.uinteger(r))return{start:yr.create(e,t),end:yr.create(n,r)};if(yr.is(e)&&yr.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments[".concat(e,", ").concat(t,", ").concat(n,", ").concat(r,"]"))}function n(e){var t=e;return so.objectLiteral(t)&&yr.is(t.start)&&yr.is(t.end)}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(xr||(xr={})),function(e){function t(e,t){return{uri:e,range:t}}function n(e){var t=e;return so.defined(t)&&xr.is(t.range)&&(so.string(t.uri)||so.undefined(t.uri))}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(wr||(wr={})),function(e){function t(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}}function n(e){var t=e;return so.defined(t)&&xr.is(t.targetRange)&&so.string(t.targetUri)&&xr.is(t.targetSelectionRange)&&(xr.is(t.originSelectionRange)||so.undefined(t.originSelectionRange))}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(Cr||(Cr={})),function(e){function t(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}}function n(e){var t=e;return so.objectLiteral(t)&&so.numberRange(t.red,0,1)&&so.numberRange(t.green,0,1)&&so.numberRange(t.blue,0,1)&&so.numberRange(t.alpha,0,1)}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(kr||(kr={})),function(e){function t(e,t){return{range:e,color:t}}function n(e){var t=e;return so.objectLiteral(t)&&xr.is(t.range)&&kr.is(t.color)}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(Er||(Er={})),function(e){function t(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}}function n(e){var t=e;return so.objectLiteral(t)&&so.string(t.label)&&(so.undefined(t.textEdit)||jr.is(t))&&(so.undefined(t.additionalTextEdits)||so.typedArray(t.additionalTextEdits,jr.is))}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(Sr||(Sr={})),(_r=Tr||(Tr={})).Comment="comment",_r.Imports="imports",_r.Region="region",function(e){function t(e,t,n,r,i,o){var a={startLine:e,endLine:t};return so.defined(n)&&(a.startCharacter=n),so.defined(r)&&(a.endCharacter=r),so.defined(i)&&(a.kind=i),so.defined(o)&&(a.collapsedText=o),a}function n(e){var t=e;return so.objectLiteral(t)&&so.uinteger(t.startLine)&&so.uinteger(t.startLine)&&(so.undefined(t.startCharacter)||so.uinteger(t.startCharacter))&&(so.undefined(t.endCharacter)||so.uinteger(t.endCharacter))&&(so.undefined(t.kind)||so.string(t.kind))}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(Ir||(Ir={})),function(e){function t(e,t){return{location:e,message:t}}function n(e){var t=e;return so.defined(t)&&wr.is(t.location)&&so.string(t.message)}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(Rr||(Rr={})),(Or=Nr||(Nr={})).Error=1,Or.Warning=2,Or.Information=3,Or.Hint=4,(Pr=Mr||(Mr={})).Unnecessary=1,Pr.Deprecated=2,function(e){function t(e){var t=e;return so.objectLiteral(t)&&so.string(t.href)}ie(t,"is"),e.is=t}(Dr||(Dr={})),function(e){function t(e,t,n,r,i,o){var a={range:e,message:t};return so.defined(n)&&(a.severity=n),so.defined(r)&&(a.code=r),so.defined(i)&&(a.source=i),so.defined(o)&&(a.relatedInformation=o),a}function n(e){var t,n=e;return so.defined(n)&&xr.is(n.range)&&so.string(n.message)&&(so.number(n.severity)||so.undefined(n.severity))&&(so.integer(n.code)||so.string(n.code)||so.undefined(n.code))&&(so.undefined(n.codeDescription)||so.string(null===(t=n.codeDescription)||void 0===t?void 0:t.href))&&(so.string(n.source)||so.undefined(n.source))&&(so.undefined(n.relatedInformation)||so.typedArray(n.relatedInformation,Rr.is))}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(Ar||(Ar={})),function(e){function t(e,t){for(var n=[],r=2;r0&&(i.arguments=n),i}function n(e){var t=e;return so.defined(t)&&so.string(t.title)&&so.string(t.command)}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(Zr||(Zr={})),function(e){function t(e,t){return{range:e,newText:t}}function n(e,t){return{range:{start:e,end:e},newText:t}}function r(e){return{range:e,newText:""}}function i(e){var t=e;return so.objectLiteral(t)&&so.string(t.newText)&&xr.is(t.range)}ie(t,"replace"),e.replace=t,ie(n,"insert"),e.insert=n,ie(r,"del"),e.del=r,ie(i,"is"),e.is=i}(jr||(jr={})),function(e){function t(e,t,n){var r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r}function n(e){var t=e;return so.objectLiteral(t)&&so.string(t.label)&&(so.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(so.string(t.description)||void 0===t.description)}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(Lr||(Lr={})),function(e){function t(e){var t=e;return so.string(t)}ie(t,"is"),e.is=t}(Fr||(Fr={})),function(e){function t(e,t,n){return{range:e,newText:t,annotationId:n}}function n(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}}function r(e,t){return{range:e,newText:"",annotationId:t}}function i(e){var t=e;return jr.is(t)&&(Lr.is(t.annotationId)||Fr.is(t.annotationId))}ie(t,"replace"),e.replace=t,ie(n,"insert"),e.insert=n,ie(r,"del"),e.del=r,ie(i,"is"),e.is=i}(zr||(zr={})),function(e){function t(e,t){return{textDocument:e,edits:t}}function n(e){var t=e;return so.defined(t)&&si.is(t.textDocument)&&Array.isArray(t.edits)}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(Br||(Br={})),function(e){function t(e,t,n){var r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r}function n(e){var t=e;return t&&"create"===t.kind&&so.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||so.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||so.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||Fr.is(t.annotationId))}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(Vr||(Vr={})),function(e){function t(e,t,n,r){var i={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i}function n(e){var t=e;return t&&"rename"===t.kind&&so.string(t.oldUri)&&so.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||so.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||so.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||Fr.is(t.annotationId))}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(Hr||(Hr={})),function(e){function t(e,t,n){var r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r}function n(e){var t=e;return t&&"delete"===t.kind&&so.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||so.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||so.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||Fr.is(t.annotationId))}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(Ur||(Ur={})),function(e){function t(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return so.string(e.kind)?Vr.is(e)||Hr.is(e)||Ur.is(e):Br.is(e)})))}ie(t,"is"),e.is=t}(qr||(qr={}));var ai,li,si,ui,ci,di,fi,pi,hi,vi,mi,gi,bi,yi,xi,wi,Ci,ki,Ei,Si,Ti,_i,Ii,Ri,Ni,Oi,Mi,Pi,Di,Ai,Zi,ji,Li,Fi,zi,Bi,Vi,Hi,Ui,qi,Wi,Gi,Ki,$i,Qi,Yi,Ji,Xi,eo,to,no,ro,io,oo,ao=function(){function e(e,t){this.edits=e,this.changeAnnotations=t}return ie(e,"TextEditChangeImpl"),e.prototype.insert=function(e,t,n){var r,i;if(void 0===n?r=jr.insert(e,t):Fr.is(n)?(i=n,r=zr.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=zr.insert(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.replace=function(e,t,n){var r,i;if(void 0===n?r=jr.replace(e,t):Fr.is(n)?(i=n,r=zr.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=zr.replace(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.delete=function(e,t){var n,r;if(void 0===t?n=jr.del(e):Fr.is(t)?(r=t,n=zr.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=zr.del(e,r)),this.edits.push(n),void 0!==r)return r},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(e){if(void 0===e)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),lo=function(){function e(e){this._annotations=void 0===e?Object.create(null):e,this._counter=0,this._size=0}return ie(e,"ChangeAnnotations"),e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(e,t){var n;if(Fr.is(e)?n=e:(n=this.nextId(),t=e),void 0!==this._annotations[n])throw new Error("Id ".concat(n," is already in use."));if(void 0===t)throw new Error("No annotation provided for id ".concat(n));return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}();!function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new lo(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(Br.is(e)){var n=new ao(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}}))):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new ao(e.changes[n]);t._textEditChanges[n]=r}))):this._workspaceEdit={}}ie(e,"WorkspaceChange"),Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),void 0!==this._changeAnnotations&&(0===this._changeAnnotations.size?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(e){if(si.is(e)){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version};if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:i=[]};this._workspaceEdit.documentChanges.push(n),r=new ao(i,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}if(this.initChanges(),void 0===this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var i=[];this._workspaceEdit.changes[e]=i,r=new ao(i),this._textEditChanges[e]=r}return r},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new lo,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(Lr.is(t)||Fr.is(t)?r=t:n=t,void 0===r?i=Vr.create(e,n):(o=Fr.is(r)?r:this._changeAnnotations.manage(r),i=Vr.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o},e.prototype.renameFile=function(e,t,n,r){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var i,o,a;if(Lr.is(n)||Fr.is(n)?i=n:r=n,void 0===i?o=Hr.create(e,t,r):(a=Fr.is(i)?i:this._changeAnnotations.manage(i),o=Hr.create(e,t,r,a)),this._workspaceEdit.documentChanges.push(o),void 0!==a)return a},e.prototype.deleteFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(Lr.is(t)||Fr.is(t)?r=t:n=t,void 0===r?i=Ur.create(e,n):(o=Fr.is(r)?r:this._changeAnnotations.manage(r),i=Ur.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o}}(),function(e){function t(e){return{uri:e}}function n(e){var t=e;return so.defined(t)&&so.string(t.uri)}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(ai||(ai={})),function(e){function t(e,t){return{uri:e,version:t}}function n(e){var t=e;return so.defined(t)&&so.string(t.uri)&&so.integer(t.version)}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(li||(li={})),function(e){function t(e,t){return{uri:e,version:t}}function n(e){var t=e;return so.defined(t)&&so.string(t.uri)&&(null===t.version||so.integer(t.version))}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(si||(si={})),function(e){function t(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}}function n(e){var t=e;return so.defined(t)&&so.string(t.uri)&&so.string(t.languageId)&&so.integer(t.version)&&so.string(t.text)}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(ui||(ui={})),function(e){function t(t){var n=t;return n===e.PlainText||n===e.Markdown}e.PlainText="plaintext",e.Markdown="markdown",ie(t,"is"),e.is=t}(ci||(ci={})),function(e){function t(e){var t=e;return so.objectLiteral(e)&&ci.is(t.kind)&&so.string(t.value)}ie(t,"is"),e.is=t}(di||(di={})),(pi=fi||(fi={})).Text=1,pi.Method=2,pi.Function=3,pi.Constructor=4,pi.Field=5,pi.Variable=6,pi.Class=7,pi.Interface=8,pi.Module=9,pi.Property=10,pi.Unit=11,pi.Value=12,pi.Enum=13,pi.Keyword=14,pi.Snippet=15,pi.Color=16,pi.File=17,pi.Reference=18,pi.Folder=19,pi.EnumMember=20,pi.Constant=21,pi.Struct=22,pi.Event=23,pi.Operator=24,pi.TypeParameter=25,(vi=hi||(hi={})).PlainText=1,vi.Snippet=2,(mi||(mi={})).Deprecated=1,function(e){function t(e,t,n){return{newText:e,insert:t,replace:n}}function n(e){var t=e;return t&&so.string(t.newText)&&xr.is(t.insert)&&xr.is(t.replace)}ie(t,"create"),e.create=t,ie(n,"is"),e.is=n}(gi||(gi={})),(yi=bi||(bi={})).asIs=1,yi.adjustIndentation=2,function(e){function t(e){var t=e;return t&&(so.string(t.detail)||void 0===t.detail)&&(so.string(t.description)||void 0===t.description)}ie(t,"is"),e.is=t}(xi||(xi={})),function(e){function t(e){return{label:e}}ie(t,"create"),e.create=t}(wi||(wi={})),function(e){function t(e,t){return{items:e||[],isIncomplete:!!t}}ie(t,"create"),e.create=t}(Ci||(Ci={})),function(e){function t(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function n(e){var t=e;return so.string(t)||so.objectLiteral(t)&&so.string(t.language)&&so.string(t.value)}ie(t,"fromPlainText"),e.fromPlainText=t,ie(n,"is"),e.is=n}(ki||(ki={})),function(e){function t(e){var t=e;return!!t&&so.objectLiteral(t)&&(di.is(t.contents)||ki.is(t.contents)||so.typedArray(t.contents,ki.is))&&(void 0===e.range||xr.is(e.range))}ie(t,"is"),e.is=t}(Ei||(Ei={})),function(e){function t(e,t){return t?{label:e,documentation:t}:{label:e}}ie(t,"create"),e.create=t}(Si||(Si={})),function(e){function t(e,t){for(var n=[],r=2;r=0;a--){var l=r[a],s=e.offsetAt(l.range.start),u=e.offsetAt(l.range.end);if(!(u<=o))throw new Error("Overlapping edit");n=n.substring(0,s)+l.newText+n.substring(u,n.length),o=s}return n}function i(e,t){if(e.length<=1)return e;var n=e.length/2|0,r=e.slice(0,n),o=e.slice(n);i(r,t),i(o,t);for(var a=0,l=0,s=0;a0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return yr.create(0,e);for(;ne?r=i:n=i+1}var o=n-1;return yr.create(o,e-t[o])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+11&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=null,o=null;if("string"===typeof e){var a=new RegExp(e,r?"i":"g");o=a.test(n._sourceText.slice(n._pos,n._pos+e.length)),i=e}else e instanceof RegExp&&(i=null===(o=n._sourceText.slice(n._pos).match(e))||void 0===o?void 0:o[0]);return!(null==o||!("string"===typeof e||o instanceof Array&&n._sourceText.startsWith(o[0],n._pos)))&&(t&&(n._start=n._pos,i&&i.length&&(n._pos+=i.length)),o)},this.backUp=function(e){n._pos-=e},this.column=function(){return n._pos},this.indentation=function(){var e=n._sourceText.match(/\s*/),t=0;if(e&&0!==e.length)for(var r=e[0],i=0;r.length>i;)9===r.charCodeAt(i)?t+=2:t++,i++;return t},this.current=function(){return n._sourceText.slice(n._start,n._pos)},this._start=0,this._pos=0,this._sourceText=t}return(0,d.Z)(e,[{key:"_testNextCharacter",value:function(e){var t=this._sourceText.charAt(this._pos);return"string"===typeof e?t===e:e instanceof RegExp?e.test(t):e(t)}}]),e}();function po(e){return{ofRule:e}}function ho(e,t){return{ofRule:e,isList:!0,separator:t}}function vo(e,t){var n=e.match;return e.match=function(e){var r=!1;return n&&(r=n(e)),r&&t.every((function(t){return t.match&&!t.match(e)}))},e}function mo(e,t){return{style:t,match:function(t){return t.kind===e}}}function go(e,t){return{style:t||"punctuation",match:function(t){return"Punctuation"===t.kind&&t.value===e}}}ie(fo,"CharacterStream"),ie(po,"opt"),ie(ho,"list$1"),ie(vo,"butNot"),ie(mo,"t$2"),ie(go,"p$1");var bo=ie((function(e){return" "===e||"\t"===e||","===e||"\n"===e||"\r"===e||"\ufeff"===e||"\xa0"===e}),"isIgnored"),yo={Name:/^[_A-Za-z][_0-9A-Za-z]*/,Punctuation:/^(?:!|\$|\(|\)|\.\.\.|:|=|&|@|\[|]|\{|\||\})/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^(?:"""(?:\\"""|[^"]|"[^"]|""[^"])*(?:""")?|"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?)/,Comment:/^#.*/},xo=(L={Document:[ho("Definition")],Definition:function(e){switch(e.value){case"{":return"ShortQuery";case"query":return"Query";case"mutation":return"Mutation";case"subscription":return"Subscription";case"fragment":return O.h.FRAGMENT_DEFINITION;case"schema":return"SchemaDef";case"scalar":return"ScalarDef";case"type":return"ObjectTypeDef";case"interface":return"InterfaceDef";case"union":return"UnionDef";case"enum":return"EnumDef";case"input":return"InputDef";case"extend":return"ExtendDef";case"directive":return"DirectiveDef"}},ShortQuery:["SelectionSet"],Query:[wo("query"),po(Co("def")),po("VariableDefinitions"),ho("Directive"),"SelectionSet"],Mutation:[wo("mutation"),po(Co("def")),po("VariableDefinitions"),ho("Directive"),"SelectionSet"],Subscription:[wo("subscription"),po(Co("def")),po("VariableDefinitions"),ho("Directive"),"SelectionSet"],VariableDefinitions:[go("("),ho("VariableDefinition"),go(")")],VariableDefinition:["Variable",go(":"),"Type",po("DefaultValue")],Variable:[go("$","variable"),Co("variable")],DefaultValue:[go("="),"Value"],SelectionSet:[go("{"),ho("Selection"),go("}")],Selection:function(e,t){return"..."===e.value?t.match(/[\s\u00a0,]*(on\b|@|{)/,!1)?"InlineFragment":"FragmentSpread":t.match(/[\s\u00a0,]*:/,!1)?"AliasedField":"Field"},AliasedField:[Co("property"),go(":"),Co("qualifier"),po("Arguments"),ho("Directive"),po("SelectionSet")],Field:[Co("property"),po("Arguments"),ho("Directive"),po("SelectionSet")],Arguments:[go("("),ho("Argument"),go(")")],Argument:[Co("attribute"),go(":"),"Value"],FragmentSpread:[go("..."),Co("def"),ho("Directive")],InlineFragment:[go("..."),po("TypeCondition"),ho("Directive"),"SelectionSet"],FragmentDefinition:[wo("fragment"),po(vo(Co("def"),[wo("on")])),"TypeCondition",ho("Directive"),"SelectionSet"],TypeCondition:[wo("on"),"NamedType"],Value:function(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue";case"$":return"Variable";case"&":return"NamedType"}return null;case"Name":switch(e.value){case"true":case"false":return"BooleanValue"}return"null"===e.value?"NullValue":"EnumValue"}},NumberValue:[mo("Number","number")],StringValue:[{style:"string",match:function(e){return"String"===e.kind},update:function(e,t){t.value.startsWith('"""')&&(e.inBlockstring=!t.value.slice(3).endsWith('"""'))}}],BooleanValue:[mo("Name","builtin")],NullValue:[mo("Name","keyword")],EnumValue:[Co("string-2")],ListValue:[go("["),ho("Value"),go("]")],ObjectValue:[go("{"),ho("ObjectField"),go("}")],ObjectField:[Co("attribute"),go(":"),"Value"],Type:function(e){return"["===e.value?"ListType":"NonNullType"},ListType:[go("["),"Type",go("]"),po(go("!"))],NonNullType:["NamedType",po(go("!"))],NamedType:[ko("atom")],Directive:[go("@","meta"),Co("meta"),po("Arguments")],DirectiveDef:[wo("directive"),go("@","meta"),Co("meta"),po("ArgumentsDef"),wo("on"),ho("DirectiveLocation",go("|"))],InterfaceDef:[wo("interface"),Co("atom"),po("Implements"),ho("Directive"),go("{"),ho("FieldDef"),go("}")],Implements:[wo("implements"),ho("NamedType",go("&"))],DirectiveLocation:[Co("string-2")],SchemaDef:[wo("schema"),ho("Directive"),go("{"),ho("OperationTypeDef"),go("}")],OperationTypeDef:[Co("keyword"),go(":"),Co("atom")],ScalarDef:[wo("scalar"),Co("atom"),ho("Directive")],ObjectTypeDef:[wo("type"),Co("atom"),po("Implements"),ho("Directive"),go("{"),ho("FieldDef"),go("}")],FieldDef:[Co("property"),po("ArgumentsDef"),go(":"),"Type",ho("Directive")],ArgumentsDef:[go("("),ho("InputValueDef"),go(")")],InputValueDef:[Co("attribute"),go(":"),"Type",po("DefaultValue"),ho("Directive")],UnionDef:[wo("union"),Co("atom"),ho("Directive"),go("="),ho("UnionMember",go("|"))],UnionMember:["NamedType"],EnumDef:[wo("enum"),Co("atom"),ho("Directive"),go("{"),ho("EnumValueDef"),go("}")],EnumValueDef:[Co("string-2"),ho("Directive")],InputDef:[wo("input"),Co("atom"),ho("Directive"),go("{"),ho("InputValueDef"),go("}")],ExtendDef:[wo("extend"),"ExtensionDefinition"],ExtensionDefinition:function(e){switch(e.value){case"schema":return O.h.SCHEMA_EXTENSION;case"scalar":return O.h.SCALAR_TYPE_EXTENSION;case"type":return O.h.OBJECT_TYPE_EXTENSION;case"interface":return O.h.INTERFACE_TYPE_EXTENSION;case"union":return O.h.UNION_TYPE_EXTENSION;case"enum":return O.h.ENUM_TYPE_EXTENSION;case"input":return O.h.INPUT_OBJECT_TYPE_EXTENSION}}},(0,u.Z)(L,O.h.SCHEMA_EXTENSION,["SchemaDef"]),(0,u.Z)(L,O.h.SCALAR_TYPE_EXTENSION,["ScalarDef"]),(0,u.Z)(L,O.h.OBJECT_TYPE_EXTENSION,["ObjectTypeDef"]),(0,u.Z)(L,O.h.INTERFACE_TYPE_EXTENSION,["InterfaceDef"]),(0,u.Z)(L,O.h.UNION_TYPE_EXTENSION,["UnionDef"]),(0,u.Z)(L,O.h.ENUM_TYPE_EXTENSION,["EnumDef"]),(0,u.Z)(L,O.h.INPUT_OBJECT_TYPE_EXTENSION,["InputDef"]),L);function wo(e){return{style:"keyword",match:function(t){return"Name"===t.kind&&t.value===e}}}function Co(e){return{style:e,match:function(e){return"Name"===e.kind},update:function(e,t){e.name=t.value}}}function ko(e){return{style:e,match:function(e){return"Name"===e.kind},update:function(e,t){var n;(null===(n=e.prevState)||void 0===n?void 0:n.prevState)&&(e.name=t.value,e.prevState.prevState.type=t.value)}}}function Eo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{eatWhitespace:function(e){return e.eatWhile(bo)},lexRules:yo,parseRules:xo,editorConfig:{}};return{startState:function(){var t={level:0,step:0,name:null,kind:null,type:null,rule:null,needsSeparator:!1,prevState:null};return Io(e.parseRules,t,O.h.DOCUMENT),t},token:function(t,n){return So(t,n,e)}}}function So(e,t,n){var r;if(t.inBlockstring)return e.match(/.*"""/)?(t.inBlockstring=!1,"string"):(e.skipToEnd(),"string");var i=n.lexRules,o=n.parseRules,a=n.eatWhitespace,l=n.editorConfig;if(t.rule&&0===t.rule.length?Ro(t):t.needsAdvance&&(t.needsAdvance=!1,No(t,!0)),e.sol()){var s=(null===l||void 0===l?void 0:l.tabSize)||2;t.indentLevel=Math.floor(e.indentation()/s)}if(a(e))return"ws";var u=Po(i,e);if(!u)return e.match(/\S+/)||e.match(/\s/),Io(_o,t,"Invalid"),"invalidchar";if("Comment"===u.kind)return Io(_o,t,"Comment"),"comment";var c=To({},t);if("Punctuation"===u.kind)if(/^[{([]/.test(u.value))void 0!==t.indentLevel&&(t.levels=(t.levels||[]).concat(t.indentLevel+1));else if(/^[})\]]/.test(u.value)){var d=t.levels=(t.levels||[]).slice(0,-1);t.indentLevel&&d.length>0&&d.at(-1)0&&l.push.apply(l,(0,f.Z)(i)),ei(e,l.filter((function(e){return o[e.typeCondition.name.value]&&!(a&&a.kind===Do.FRAGMENT_DEFINITION&&a.name===e.name.value)&&(0,I.Gv)(t.parentType)&&(0,I.Gv)(o[e.typeCondition.name.value])&&(0,H.zR)(n,t.parentType,o[e.typeCondition.name.value])})).map((function(e){return{label:e.name.value,detail:String(o[e.typeCondition.name.value]),documentation:"fragment ".concat(e.name.value," on ").concat(e.typeCondition.name.value),kind:uo.Field,type:o[e.typeCondition.name.value]}})))}ie(Vo,"getSuggestionsForTypeSystemDefinitions"),ie(Ho,"getSuggestionsForExecutableDefinitions"),ie(Uo,"getSuggestionsForExtensionDefinitions"),ie(qo,"getSuggestionsForFieldNames"),ie(Wo,"getSuggestionsForInputValues"),ie(Go,"getSuggestionsForImplements"),ie(Ko,"getSuggestionsForFragmentTypeConditions"),ie($o,"getSuggestionsForFragmentSpread");var Qo,Yo,Jo=ie((function(e,t){var n,r,i,o,a,l,s,u,c,d;return(null===(n=e.prevState)||void 0===n?void 0:n.kind)===t?e.prevState:(null===(i=null===(r=e.prevState)||void 0===r?void 0:r.prevState)||void 0===i?void 0:i.kind)===t?e.prevState.prevState:(null===(l=null===(a=null===(o=e.prevState)||void 0===o?void 0:o.prevState)||void 0===a?void 0:a.prevState)||void 0===l?void 0:l.kind)===t?e.prevState.prevState.prevState:(null===(d=null===(c=null===(u=null===(s=e.prevState)||void 0===s?void 0:s.prevState)||void 0===u?void 0:u.prevState)||void 0===c?void 0:c.prevState)||void 0===d?void 0:d.kind)===t?e.prevState.prevState.prevState.prevState:void 0}),"getParentDefinition");function Xo(e,t,n){var r,i=null,o=Object.create({});return ia(e,(function(e,a){if((null===a||void 0===a?void 0:a.kind)===Do.VARIABLE&&a.name&&(i=a.name),(null===a||void 0===a?void 0:a.kind)===Do.NAMED_TYPE&&i){var l=Jo(a,Do.TYPE);(null===l||void 0===l?void 0:l.type)&&(r=t.getType(null===l||void 0===l?void 0:l.type))}i&&r&&!o[i]&&(o[i]={detail:r.toString(),insertText:"$"===n.string?i:"$"+i,label:i,type:r,kind:uo.Variable},i=null,r=null)})),Xr(o)}function ea(e){var t=[];return ia(e,(function(e,n){n.kind===Do.FRAGMENT_DEFINITION&&n.name&&n.type&&t.push({kind:Do.FRAGMENT_DEFINITION,name:{kind:O.h.NAME,value:n.name},selectionSet:{kind:Do.SELECTION_SET,selections:[]},typeCondition:{kind:Do.NAMED_TYPE,name:{kind:O.h.NAME,value:n.type}}})})),t}function ta(e,t,n){return ei(e,Xr(t.getTypeMap()).filter(I.j$).map((function(e){return{label:e.name,documentation:e.description,kind:uo.Variable}})))}function na(e,t,n,r){var i;return(null===(i=t.prevState)||void 0===i?void 0:i.kind)?ei(e,n.getDirectives().filter((function(e){return oa(t.prevState,e)})).map((function(e){return{label:e.name,documentation:e.description||"",kind:uo.Function}}))):[]}function ra(e,t){var n=null,r=null,i=null,o=ia(e,(function(e,o,a,l){if(l===t.line&&e.getCurrentPosition()>=t.character)return n=a,r=Object.assign({},o),i=e.current(),"BREAK"}));return{start:o.start,end:o.end,string:i||o.string,state:r||o.state,style:n||o.style}}function ia(e,t){for(var n=e.split("\n"),r=Eo(),i=r.startState(),o="",a=new fo(""),l=0;l1&&void 0!==arguments[1]?arguments[1]:{},n=t.separator||".",r="/"!==n&&t.preservePaths;if("string"===typeof e&&!1!==r&&/\//.test(e))return[e];for(var i=[],o="",a=ie((function(e){var t;""!==e.trim()&&Number.isInteger(t=Number(e))?i.push(t):i.push(e)}),"push"),l=0;l=0||(i[n]=e[n]);return i}ie(Kl,"useForceUpdate"),ie($l,"_objectWithoutPropertiesLoose$b");var Ql=["unstable_skipInitialRender"],Yl=ie((function(e){var t=e.children,n=e.type,r=void 0===n?"reach-portal":n,i=e.containerRef,o=(0,g.useRef)(null),a=(0,g.useRef)(null),l=Kl();return Gl((function(){if(o.current){var e=o.current.ownerDocument,t=(null==i?void 0:i.current)||e.body;return a.current=null==e?void 0:e.createElement(r),t.appendChild(a.current),l(),function(){a.current&&t&&t.removeChild(a.current)}}}),[r,l,i]),a.current?(0,K.createPortal)(t,a.current):(0,g.createElement)("span",{ref:o})}),"PortalImpl"),Jl=ie((function(e){var t=e.unstable_skipInitialRender,n=$l(e,Ql),r=(0,g.useState)(!1),i=r[0],o=r[1];return(0,g.useEffect)((function(){t&&o(!0)}),[t]),t&&!i?null:(0,g.createElement)(Yl,n)}),"Portal");function Xl(e){return Wl()?e?e.ownerDocument:document:null}function es(e){return"boolean"===typeof e}function ts(e){return!(!e||"[object Function]"!={}.toString.call(e))}function ns(e){return"string"===typeof e}function rs(){}function is(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}function ls(e,t){if(null!=e)if(ts(e))e(t);else try{e.current=t}catch(n){throw new Error('Cannot assign value "'+t+'" to ref "'+e+'"')}}function ss(){for(var e=arguments.length,t=new Array(e),n=0;n=0||(i[n]=e[n]);return i}function ds(){return ds=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0})).sort(iu)}),"orderByTabIndex"),au=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"].join(","),lu="".concat(au,", [data-focus-guard]"),su=ie((function(e,t){var n;return zs((null===(n=e.shadowRoot)||void 0===n?void 0:n.children)||e.children).reduce((function(e,n){return e.concat(n.matches(t?lu:au)?[n]:[],su(n))}),[])}),"getFocusablesWithShadowDom"),uu=ie((function(e,t){return e.reduce((function(e,n){return e.concat(su(n,t),n.parentNode?zs(n.parentNode.querySelectorAll(au)).filter((function(e){return e===n})):[])}),[])}),"getFocusables"),cu=ie((function(e){var t=e.querySelectorAll("[".concat("data-autofocus-inside","]"));return zs(t).map((function(e){return uu([e])})).reduce((function(e,t){return e.concat(t)}),[])}),"getParentAutofocusables"),du=ie((function(e,t){return zs(e).filter((function(e){return Ws(t,e)})).filter((function(e){return Xs(e)}))}),"filterFocusable"),fu=ie((function(e,t){return void 0===t&&(t=new Map),zs(e).filter((function(e){return Ks(t,e)}))}),"filterAutoFocusable"),pu=ie((function(e,t,n){return ou(du(uu(e,n),t),!0,n)}),"getTabbableNodes"),hu=ie((function(e,t){return ou(du(uu(e),t),!1)}),"getAllTabbableNodes"),vu=ie((function(e,t){return du(cu(e),t)}),"parentAutofocusables"),mu=ie((function(e,t){return(e.shadowRoot?mu(e.shadowRoot,t):Object.getPrototypeOf(e).contains.call(e,t))||zs(e.children).some((function(e){return mu(e,t)}))}),"contains"),gu=ie((function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(i),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter((function(e,n){return!t.has(n)}))}),"filterNested"),bu=ie((function(e){return e.parentNode?bu(e.parentNode):e}),"getTopParent"),yu=ie((function(e){return Bs(e).filter(Boolean).reduce((function(e,t){var n=t.getAttribute(hs);return e.push.apply(e,n?gu(zs(bu(t).querySelectorAll("[".concat(hs,'="').concat(n,'"]:not([').concat(vs,'="disabled"])')))):[t]),e}),[])}),"getAllAffectedNodes"),xu=ie((function(e){return e.activeElement?e.activeElement.shadowRoot?xu(e.activeElement.shadowRoot):e.activeElement:void 0}),"getNestedShadowActiveElement"),wu=ie((function(){return document.activeElement?document.activeElement.shadowRoot?xu(document.activeElement.shadowRoot):document.activeElement:void 0}),"getActiveElement"),Cu=ie((function(e){return e===document.activeElement}),"focusInFrame"),ku=ie((function(e){return Boolean(zs(e.querySelectorAll("iframe")).some((function(e){return Cu(e)})))}),"focusInsideIframe"),Eu=ie((function(e){var t=document&&wu();return!(!t||t.dataset&&t.dataset.focusGuard)&&yu(e).some((function(e){return mu(e,t)||ku(e)}))}),"focusInside"),Su=ie((function(){var e=document&&wu();return!!e&&zs(document.querySelectorAll("[".concat("data-no-focus-lock","]"))).some((function(t){return mu(t,e)}))}),"focusIsHidden"),Tu=ie((function(e,t){return t.filter(Js).filter((function(t){return t.name===e.name})).filter((function(e){return e.checked}))[0]||e}),"findSelectedRadio"),_u=ie((function(e,t){return Js(e)&&e.name?Tu(e,t):e}),"correctNode"),Iu=ie((function(e){var t=new Set;return e.forEach((function(n){return t.add(_u(n,e))})),e.filter((function(e){return t.has(e)}))}),"correctNodes"),Ru=ie((function(e){return e[0]&&e.length>1?_u(e[0],e):e[0]}),"pickFirstFocus"),Nu=ie((function(e,t){return e.length>1?e.indexOf(_u(e[t],e)):t}),"pickFocusable"),Ou="NEW_FOCUS",Mu=ie((function(e,t,n,r){var i=e.length,o=e[0],a=e[i-1],l=tu(n);if(!(n&&e.indexOf(n)>=0)){var s=void 0!==n?t.indexOf(n):-1,u=r?t.indexOf(r):s,c=r?e.indexOf(r):-1,d=s-u,f=t.indexOf(o),p=t.indexOf(a),h=Iu(t),v=(void 0!==n?h.indexOf(n):-1)-(r?h.indexOf(r):s),m=Nu(e,0),g=Nu(e,i-1);return-1===s||-1===c?Ou:!d&&c>=0?c:s<=f&&l&&Math.abs(d)>1?g:s>=p&&l&&Math.abs(d)>1?m:d&&Math.abs(v)>1?c:s<=f?g:s>p?m:d?Math.abs(d)>1?c:(i+c+d)%i:void 0}}),"newFocus"),Pu=ie((function(e,t){return void 0===t&&(t=[]),t.push(e),e.parentNode&&Pu(e.parentNode.host||e.parentNode,t),t}),"getParents"),Du=ie((function(e,t){for(var n=Pu(e),r=Pu(t),i=0;i=0)return o}return!1}),"getCommonParent"),Au=ie((function(e,t,n){var r=Bs(e),i=Bs(t),o=r[0],a=!1;return i.filter(Boolean).forEach((function(e){a=Du(a||e,e)||a,n.filter(Boolean).forEach((function(e){var t=Du(o,e);t&&(a=!a||mu(t,a)?t:Du(t,a))}))})),a}),"getTopCommonParent"),Zu=ie((function(e,t){return e.reduce((function(e,n){return e.concat(vu(n,t))}),[])}),"allParentAutofocusables"),ju=ie((function(e){return function(t){var n;return t.autofocus||!!(null===(n=$s(t))||void 0===n?void 0:n.autofocus)||e.indexOf(t)>=0}}),"findAutoFocused"),Lu=ie((function(e,t){var n=new Map;return t.forEach((function(e){return n.set(e.node,e)})),e.map((function(e){return n.get(e)})).filter(ru)}),"reorderNodes"),Fu=ie((function(e,t){var n=document&&wu(),r=yu(e).filter(nu),i=Au(n||e,e,r),o=new Map,a=hu(r,o),l=pu(r,o).filter((function(e){var t=e.node;return nu(t)}));if(l[0]||(l=a)[0]){var s=hu([i],o).map((function(e){return e.node})),u=Lu(s,l),c=u.map((function(e){return e.node})),d=Mu(c,s,n,t);if(d===Ou){var f=fu(a.map((function(e){return e.node}))).filter(ju(Zu(r,o)));return{node:f&&f.length?Ru(f):Ru(fu(c))}}return void 0===d?d:u[d]}}),"getFocusMerge"),zu=ie((function(e){var t=yu(e).filter(nu),n=Au(e,e,t),r=new Map,i=pu([n],r,!0),o=pu(t,r).filter((function(e){var t=e.node;return nu(t)})).map((function(e){return e.node}));return i.map((function(e){var t=e.node;return{node:t,index:e.index,lockItem:o.indexOf(t)>=0,guard:tu(t)}}))}),"getFocusabledIn"),Bu=ie((function(e,t){"focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus()}),"focusOn"),Vu=0,Hu=!1,Uu=ie((function(e,t,n){void 0===n&&(n={});var r=Fu(e,t);if(!Hu&&r){if(Vu>2)return console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Hu=!0,void setTimeout((function(){Hu=!1}),1);Vu++,Bu(r.node,n.focusOptions),Vu--}}),"setFocus"),qu=Uu;function Wu(e){var t=window.setImmediate;"undefined"!==typeof t?t(e):setTimeout(e,1)}ie(Wu,"deferAction");var Gu=ie((function(){return document&&document.activeElement===document.body}),"focusOnBody"),Ku=ie((function(){return Gu()||Su()}),"isFreeFocus"),$u=null,Qu=null,Yu=null,Ju=!1,Xu=ie((function(){return!0}),"defaultWhitelist"),ec=ie((function(e){return($u.whiteList||Xu)(e)}),"focusWhitelisted"),tc=ie((function(e,t){Yu={observerNode:e,portaledElement:t}}),"recordPortal"),nc=ie((function(e){return Yu&&Yu.portaledElement===e}),"focusIsPortaledPair");function rc(e,t,n,r){var i=null,o=e;do{var a=r[o];if(a.guard)a.node.dataset.focusAutoGuard&&(i=a);else{if(!a.lockItem)break;if(o!==e)return;i=null}}while((o+=n)!==t);i&&(i.node.tabIndex=0)}ie(rc,"autoGuard");var ic=ie((function(e){return e&&"current"in e?e.current:e}),"extractRef"),oc=ie((function(e){return e?Boolean(Ju):"meanwhile"===Ju}),"focusWasOutside"),ac=ie((function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))}),"checkInHost"),lc=ie((function(e,t){return t.some((function(t){return ac(e,t,t)}))}),"withinHost"),sc=ie((function(){var e=!1;if($u){var t=$u,n=t.observed,r=t.persistentFocus,i=t.autoFocus,o=t.shards,a=t.crossFrame,l=t.focusOptions,s=n||Yu&&Yu.portaledElement,u=document&&document.activeElement;if(s){var c=[s].concat(o.map(ic).filter(Boolean));if(u&&!ec(u)||(r||oc(a)||!Ku()||!Qu&&i)&&(s&&!(Eu(c)||u&&lc(u,c)||nc(u))&&(document&&!Qu&&u&&!i?(u.blur&&u.blur(),document.body.focus()):(e=qu(c,Qu,{focusOptions:l}),Yu={})),Ju=!1,Qu=document&&document.activeElement),document){var d=document&&document.activeElement,f=zu(c),p=f.map((function(e){return e.node})).indexOf(d);p>-1&&(f.filter((function(e){var t=e.guard,n=e.node;return t&&n.dataset.focusAutoGuard})).forEach((function(e){return e.node.removeAttribute("tabIndex")})),rc(p,f.length,1,f),rc(p,-1,-1,f))}}}return e}),"activateTrap"),uc=ie((function(e){sc()&&e&&(e.stopPropagation(),e.preventDefault())}),"onTrap"),cc=ie((function(){return Wu(sc)}),"onBlur"),dc=ie((function(e){var t=e.target,n=e.currentTarget;n.contains(t)||tc(n,t)}),"onFocus"),fc=ie((function(){return null}),"FocusWatcher"),pc=ie((function(){Ju="just",setTimeout((function(){Ju="meanwhile"}),0)}),"onWindowBlur"),hc=ie((function(){document.addEventListener("focusin",uc),document.addEventListener("focusout",cc),window.addEventListener("blur",pc)}),"attachHandler"),vc=ie((function(){document.removeEventListener("focusin",uc),document.removeEventListener("focusout",cc),window.removeEventListener("blur",pc)}),"detachHandler");function mc(e){return e.filter((function(e){return!e.disabled}))}function gc(e){var t=e.slice(-1)[0];t&&!$u&&hc();var n=$u,r=n&&t&&t.id===n.id;$u=t,n&&!r&&(n.onDeactivation(),e.filter((function(e){return e.id===n.id})).length||n.returnFocus(!t)),t?(Qu=null,r&&n.observed===t.observed||t.onActivation(),sc(),Wu(sc)):(vc(),Qu=null)}ie(mc,"reducePropsToState"),ie(gc,"handleStateChangeOnClient"),Rs.assignSyncMedium(dc),Ns.assignMedium(cc),Os.assignMedium((function(e){return e({moveFocusInside:qu,focusInside:Eu})}));var bc=Fs(mc,gc)(fc),yc=g.forwardRef(ie((function(e,t){return g.createElement(As,ds({sideCar:bc,ref:t},e))}),"FocusLockUICombination")),xc=As.propTypes||{};xc.sideCar,cs(xc,["sideCar"]),yc.propTypes={};var wc=yc,Cc="right-scroll-bar-position",kc="width-before-scroll-bar",Ec=Ts(),Sc=ie((function(){}),"nothing"),Tc=g.forwardRef((function(e,t){var n=g.useRef(null),r=g.useState({onScrollCapture:Sc,onWheelCapture:Sc,onTouchMoveCapture:Sc}),i=r[0],o=r[1],a=e.forwardProps,l=e.children,s=e.className,u=e.removeScrollBar,c=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,h=e.inert,v=e.allowPinchZoom,m=e.as,b=void 0===m?"div":m,y=ws(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=f,w=bs([n,t]),C=xs(xs({},y),i);return g.createElement(g.Fragment,null,c&&g.createElement(x,{sideCar:Ec,removeScrollBar:u,shards:d,noIsolation:p,inert:h,setCallbacks:o,allowPinchZoom:!!v,lockRef:n}),a?g.cloneElement(g.Children.only(l),xs(xs({},C),{ref:w})):g.createElement(b,xs({},C,{className:s,ref:w}),l))}));Tc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Tc.classNames={fullWidth:kc,zeroRight:Cc};var _c=ie((function(){return n.nc}),"getNonce");function Ic(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_c();return t&&e.setAttribute("nonce",t),e}function Rc(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Nc(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}ie(Ic,"makeStyleTag"),ie(Rc,"injectStyles"),ie(Nc,"insertStyleTag");var Oc=ie((function(){var e=0,t=null;return{add:function(n){0==e&&(t=Ic())&&(Rc(t,n),Nc(t)),e++},remove:function(){!--e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}}),"stylesheetSingleton"),Mc=ie((function(){var e=Oc();return function(t,n){g.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])}}),"styleHookSingleton"),Pc=ie((function(){var e=Mc();return ie((function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}),"Sheet")}),"styleSingleton"),Dc={left:0,top:0,right:0,gap:0},Ac=ie((function(e){return parseInt(e||"",10)||0}),"parse$1"),Zc=ie((function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],i=t["padding"===e?"paddingRight":"marginRight"];return[Ac(n),Ac(r),Ac(i)]}),"getOffset"),jc=ie((function(e){if(void 0===e&&(e="margin"),"undefined"===typeof window)return Dc;var t=Zc(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}}),"getGapWidth"),Lc=Pc(),Fc=ie((function(e,t,n,r){var i=e.left,o=e.top,a=e.right,l=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(l,"px ").concat(r,";\n }\n body {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(i,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Cc," {\n right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(kc," {\n margin-right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(Cc," .").concat(Cc," {\n right: 0 ").concat(r,";\n }\n \n .").concat(kc," .").concat(kc," {\n margin-right: 0 ").concat(r,";\n }\n \n body {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")}),"getStyles$2"),zc=ie((function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=void 0===r?"margin":r,o=g.useMemo((function(){return jc(i)}),[i]);return g.createElement(Lc,{styles:Fc(o,!t,i,n?"":"!important")})}),"RemoveScrollBar"),Bc=!1;if("undefined"!==typeof window)try{var Vc=Object.defineProperty({},"passive",{get:function(){return Bc=!0,!0}});window.addEventListener("test",Vc,Vc),window.removeEventListener("test",Vc,Vc)}catch(TS){Bc=!1}var Hc=!!Bc&&{passive:!1},Uc=ie((function(e){return"TEXTAREA"===e.tagName}),"alwaysContainsScroll"),qc=ie((function(e,t){var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!Uc(e)&&"visible"===n[t])}),"elementCanBeScrolled"),Wc=ie((function(e){return qc(e,"overflowY")}),"elementCouldBeVScrolled"),Gc=ie((function(e){return qc(e,"overflowX")}),"elementCouldBeHScrolled"),Kc=ie((function(e,t){var n=t;do{if("undefined"!==typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Yc(e,n)){var r=Jc(e,n);if(r[1]>r[2])return!0}n=n.parentNode}while(n&&n!==document.body);return!1}),"locationCouldBeScrolled"),$c=ie((function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}),"getVScrollVariables"),Qc=ie((function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}),"getHScrollVariables"),Yc=ie((function(e,t){return"v"===e?Wc(t):Gc(t)}),"elementCouldBeScrolled"),Jc=ie((function(e,t){return"v"===e?$c(t):Qc(t)}),"getScrollVariables"),Xc=ie((function(e,t){return"h"===e&&"rtl"===t?-1:1}),"getDirectionFactor"),ed=ie((function(e,t,n,r,i){var o=Xc(e,window.getComputedStyle(t).direction),a=o*r,l=n.target,s=t.contains(l),u=!1,c=a>0,d=0,f=0;do{var p=Jc(e,l),h=p[0],v=p[1]-p[2]-o*h;(h||v)&&Yc(e,l)&&(d+=v,f+=h),l=l.parentNode}while(!s&&l!==document.body||s&&(t.contains(l)||t===l));return(c&&(i&&0===d||!i&&a>d)||!c&&(i&&0===f||!i&&-a>f))&&(u=!0),u}),"handleScroll"),td=ie((function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]}),"getTouchXY"),nd=ie((function(e){return[e.deltaX,e.deltaY]}),"getDeltaXY"),rd=ie((function(e){return e&&"current"in e?e.current:e}),"extractRef"),id=ie((function(e,t){return e[0]===t[0]&&e[1]===t[1]}),"deltaCompare"),od=ie((function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")}),"generateStyle"),ad=0,ld=[];function sd(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(ad++)[0],o=g.useState((function(){return Pc()}))[0],a=g.useRef(e);g.useEffect((function(){a.current=e}),[e]),g.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var t=Cs([e.lockRef.current],(e.shards||[]).map(rd),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(i))})),function(){document.body.classList.remove("block-interactivity-".concat(i)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(i))}))}}}),[e.inert,e.lockRef.current,e.shards]);var l=g.useCallback((function(e,t){if("touches"in e&&2===e.touches.length)return!a.current.allowPinchZoom;var i,o=td(e),l=n.current,s="deltaX"in e?e.deltaX:l[0]-o[0],u="deltaY"in e?e.deltaY:l[1]-o[1],c=e.target,d=Math.abs(s)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=Kc(d,c);if(!f)return!0;if(f?i=d:(i="v"===d?"h":"v",f=Kc(d,c)),!f)return!1;if(!r.current&&"changedTouches"in e&&(s||u)&&(r.current=i),!i)return!0;var p=r.current||i;return ed(p,t,e,"h"===p?s:u,!0)}),[]),s=g.useCallback((function(e){var n=e;if(ld.length&&ld[ld.length-1]===o){var r="deltaY"in n?nd(n):td(n),i=t.current.filter((function(e){return e.name===n.type&&e.target===n.target&&id(e.delta,r)}))[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var s=(a.current.shards||[]).map(rd).filter(Boolean).filter((function(e){return e.contains(n.target)}));(s.length>0?l(n,s[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),u=g.useCallback((function(e,n,r,i){var o={name:e,delta:n,target:r,should:i};t.current.push(o),setTimeout((function(){t.current=t.current.filter((function(e){return e!==o}))}),1)}),[]),c=g.useCallback((function(e){n.current=td(e),r.current=void 0}),[]),d=g.useCallback((function(t){u(t.type,nd(t),t.target,l(t,e.lockRef.current))}),[]),f=g.useCallback((function(t){u(t.type,td(t),t.target,l(t,e.lockRef.current))}),[]);g.useEffect((function(){return ld.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",s,Hc),document.addEventListener("touchmove",s,Hc),document.addEventListener("touchstart",c,Hc),function(){ld=ld.filter((function(e){return e!==o})),document.removeEventListener("wheel",s,Hc),document.removeEventListener("touchmove",s,Hc),document.removeEventListener("touchstart",c,Hc)}}),[]);var p=e.removeScrollBar,h=e.inert;return g.createElement(g.Fragment,null,h?g.createElement(o,{styles:od(i)}):null,p?g.createElement(zc,{gapMode:"margin"}):null)}ie(sd,"RemoveScrollSideCar");var ud=Is(Ec,sd),cd=g.forwardRef((function(e,t){return g.createElement(Tc,xs({},e,{ref:t,sideCar:ud}))}));cd.classNames=Tc.classNames;var dd=cd,fd={exports:{}};function pd(){}function hd(){}ie(pd,"emptyFunction"),ie(hd,"emptyFunctionWithReset"),hd.resetWarningCache=pd;var vd=ie((function(){function e(e,t,n,r,i,o){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}ie(e,"shim"),e.isRequired=e,ie(t,"getShim");var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:hd,resetWarningCache:pd};return n.PropTypes=n,n}),"factoryWithThrowingShims");fd.exports=vd();var md=fd.exports;function gd(){return gd=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}ie(gd,"_extends$9"),ie(bd,"_objectWithoutPropertiesLoose$9");var yd=["as","isOpen"],xd=["allowPinchZoom","as","dangerouslyBypassFocusLock","dangerouslyBypassScrollLock","initialFocusRef","onClick","onDismiss","onKeyDown","onMouseDown","unstable_lockFocusAcrossFrames"],wd=["as","onClick","onKeyDown"],Cd=["allowPinchZoom","initialFocusRef","isOpen","onDismiss"];md.bool,md.bool,md.bool,md.func;var kd=(0,g.forwardRef)(ie((function(e,t){var n=e.as,r=void 0===n?"div":n,i=e.isOpen,o=void 0===i||i,a=bd(e,yd);return(0,g.useEffect)((function(){o?window.__REACH_DISABLE_TOOLTIPS=!0:window.requestAnimationFrame((function(){window.__REACH_DISABLE_TOOLTIPS=!1}))}),[o]),o?(0,g.createElement)(Jl,{"data-reach-dialog-wrapper":""},(0,g.createElement)(Ed,gd({ref:t,as:r},a))):null}),"DialogOverlay")),Ed=(0,g.forwardRef)(ie((function(e,t){var n=e.allowPinchZoom,r=e.as,i=void 0===r?"div":r,o=e.dangerouslyBypassFocusLock,a=void 0!==o&&o,l=e.dangerouslyBypassScrollLock,s=void 0!==l&&l,u=e.initialFocusRef,c=e.onClick,d=e.onDismiss,f=void 0===d?rs:d,p=e.onKeyDown,h=e.onMouseDown,v=e.unstable_lockFocusAcrossFrames,m=bd(e,xd),b=(0,g.useRef)(null),y=(0,g.useRef)(null),x=ss(y,t),w=(0,g.useCallback)((function(){u&&u.current&&u.current.focus()}),[u]);function C(e){b.current===e.target&&(e.stopPropagation(),f(e))}function k(e){"Escape"===e.key&&(e.stopPropagation(),f(e))}function E(e){b.current=e.target}return ie(C,"handleClick"),ie(k,"handleKeyDown"),ie(E,"handleMouseDown"),(0,g.useEffect)((function(){return y.current?_d(y.current):void 0}),[]),(0,g.createElement)(wc,{autoFocus:!0,returnFocus:!0,onActivation:w,disabled:a,crossFrame:null==v||v},(0,g.createElement)(dd,{allowPinchZoom:n,enabled:!s},(0,g.createElement)(i,gd({},m,{ref:x,"data-reach-dialog-overlay":"",onClick:us(c,C),onKeyDown:us(p,k),onMouseDown:us(h,E)}))))}),"DialogInner")),Sd=(0,g.forwardRef)(ie((function(e,t){var n=e.as,r=void 0===n?"div":n,i=e.onClick;e.onKeyDown;var o=bd(e,wd);return(0,g.createElement)(r,gd({"aria-modal":"true",role:"dialog",tabIndex:-1},o,{ref:t,"data-reach-dialog-content":"",onClick:us(i,(function(e){e.stopPropagation()}))}))}),"DialogContent")),Td=(0,g.forwardRef)(ie((function(e,t){var n=e.allowPinchZoom,r=void 0!==n&&n,i=e.initialFocusRef,o=e.isOpen,a=e.onDismiss,l=void 0===a?rs:a,s=bd(e,Cd);return(0,g.createElement)(kd,{allowPinchZoom:r,initialFocusRef:i,isOpen:o,onDismiss:l},(0,g.createElement)(Sd,gd({ref:t},s)))}),"Dialog"));function _d(e){var t=[],n=[],r=Xl(e);return e?(Array.prototype.forEach.call(r.querySelectorAll("body > *"),(function(r){var i,o;if(r!==(null==(i=e.parentNode)||null==(o=i.parentNode)?void 0:o.parentNode)){var a=r.getAttribute("aria-hidden");null!==a&&"false"!==a||(t.push(a),n.push(r),r.setAttribute("aria-hidden","true"))}})),function(){n.forEach((function(e,n){var r=t[n];null===r?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r)}))}):rs}function Id(){return Id=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}ie(_d,"createAriaHider"),ie(Id,"_extends$8"),ie(Rd,"_objectWithoutPropertiesLoose$8");var Nd=["as","style"],Od=(0,g.forwardRef)(ie((function(e,t){var n=e.as,r=void 0===n?"span":n,i=e.style,o=void 0===i?{}:i,a=Rd(e,Nd);return(0,g.createElement)(r,Id({ref:t,style:Id({border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},o)},a))}),"VisuallyHidden")),Md=Object.defineProperty,Pd=ie((function(e,t){return Md(e,"name",{value:t,configurable:!0})}),"__name$D")((function(e,t){return Object.entries(t).reduce((function(e,t){var n=(0,s.Z)(t,2),r=n[0],i=n[1];return e[r]=i,e}),e)}),"createComponentGroup"),Dd=(0,g.forwardRef)((function(e,t){return Xe(Td,re(ne({},e),{ref:t}))}));Dd.displayName="Dialog";var Ad=(0,g.forwardRef)((function(e,t){return et(Hl,re(ne({},e),{ref:t,type:"button",className:le("graphiql-dialog-close",e.className),children:[Xe(Od,{children:"Close dialog"}),Xe(ml,{})]}))}));Ad.displayName="Dialog.Close";var Zd=Pd(Dd,{Close:Ad}),jd=!1,Ld=0;function Fd(){return++Ld}function zd(e){var t;if("function"===typeof g.useId){var n=(0,g.useId)(e);return null!=e?e:n}var r=null!=e?e:jd?Fd():null,i=(0,g.useState)(r),o=i[0],a=i[1];return Gl((function(){null===o&&a(Fd())}),[]),(0,g.useEffect)((function(){!1===jd&&(jd=!0)}),[]),null!=(t=null!=e?e:o)?t:void 0}ie(Fd,"genId"),ie(zd,"useId");var Bd,Vd=["bottom","height","left","right","top","width"],Hd=ie((function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),Vd.some((function(n){return e[n]!==t[n]}))}),"rectChanged"),Ud=new Map,qd=ie((function e(){var t=[];Ud.forEach((function(e,n){var r=n.getBoundingClientRect();Hd(r,e.rect)&&(e.rect=r,t.push(e))})),t.forEach((function(e){e.callbacks.forEach((function(t){return t(e.rect)}))})),Bd=window.requestAnimationFrame(e)}),"run");function Wd(e,t){return{observe:ie((function(){var n=0===Ud.size;Ud.has(e)?Ud.get(e).callbacks.push(t):Ud.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]}),n&&qd()}),"observe"),unobserve:ie((function(){var n=Ud.get(e);if(n){var r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||Ud.delete(e),Ud.size||cancelAnimationFrame(Bd)}}),"unobserve")}}function Gd(e,t,n){var r,i,o;es(t)?r=t:(r=null==(o=null==t?void 0:t.observe)||o,i=null==t?void 0:t.onChange);ts(n)&&(i=n);var a=(0,g.useState)(e.current),l=a[0],s=a[1],u=(0,g.useRef)(!1),c=(0,g.useRef)(!1),d=(0,g.useState)(null),f=d[0],p=d[1],h=(0,g.useRef)(i);return Gl((function(){h.current=i,e.current!==l&&s(e.current)})),Gl((function(){l&&!u.current&&(u.current=!0,p(l.getBoundingClientRect()))}),[l]),Gl((function(){if(r){var t=l;if(c.current||(c.current=!0,t=e.current),t){var n=Wd(t,(function(e){null==h.current||h.current(e),p(e)}));return n.observe(),function(){n.unobserve()}}}}),[r,l,e]),f}ie(Wd,"observeRect"),ie(Gd,"useRect");var Kd=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],$d=Kd.join(","),Qd="undefined"===typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function Yd(e,t){t=t||{};var n,r,i,o=[],a=[],l=e.querySelectorAll($d);for(t.includeContainer&&Qd.call(e,$d)&&(l=Array.prototype.slice.apply(l)).unshift(e),n=0;n=0||(i[n]=e[n]);return i}ie(vf,"_extends$7"),ie(mf,"_objectWithoutPropertiesLoose$7");var gf=["unstable_skipInitialPortalRender"],bf=["as","targetRef","position","unstable_observableRefs"],yf=(0,g.forwardRef)(ie((function(e,t){var n=e.unstable_skipInitialPortalRender,r=mf(e,gf);return(0,g.createElement)(Jl,{unstable_skipInitialRender:n},(0,g.createElement)(xf,vf({ref:t},r)))}),"Popover")),xf=(0,g.forwardRef)(ie((function(e,t){var n=e.as,r=void 0===n?"div":n,i=e.targetRef,o=e.position,a=void 0===o?kf:o,l=e.unstable_observableRefs,s=void 0===l?[]:l,u=mf(e,bf),c=(0,g.useRef)(null),d=Gd(c,{observe:!u.hidden}),f=Gd(i,{observe:!u.hidden}),p=ss(c,t);return Tf(i,c),(0,g.createElement)(r,vf({"data-reach-popover":"",ref:p},u,{style:vf({position:"absolute"},wf.apply(void 0,[a,f,d].concat(s)),u.style)}))}),"PopoverImpl"));function wf(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o=0||(i[n]=e[n]);return i}function If(){return If=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}ie(Nf,"createDescendantContext"),ie(Of,"useDescendant"),ie(Mf,"useDescendantsInit"),ie(Pf,"useDescendants"),ie(Df,"DescendantProvider"),ie(Af,"useDescendantKeyDown"),ie(Zf,"isRightClick"),ie(jf,"createStableCallbackHook"),ie(Lf,"useStableCallback"),ie(Ff,"_objectWithoutPropertiesLoose$5");var zf,Bf,Vf=["children"];function Hf(e,t){return(0,g.createContext)(t)}function Uf(e,t){var n=(0,g.createContext)(t);function r(e){var t=e.children,r=Ff(e,Vf),i=(0,g.useMemo)((function(){return r}),Object.values(r));return(0,g.createElement)(n.Provider,{value:i},t)}function i(r){var i=(0,g.useContext)(n);if(i)return i;if(t)return t;throw Error(r+" must be rendered inside of a "+e+" component.")}return ie(r,"Provider"),ie(i,"useContext$1"),[r,i]}function qf(){for(var e=arguments.length,t=new Array(e),n=0;n0||v,matches:Yf(o)}}}}),"x");try{for(var p=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(d),h=p.next();!h.done;h=p.next()){var v=f(h.value);if("object"==typeof v)return v.value}}catch(m){i={error:m}}finally{try{h&&!h.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}}return Xf(l,s)}};return n}ie(Kf,"e$1"),ie($f,"r$1"),ie(Qf,"i$1"),ie(Yf,"o"),ie(Jf,"a"),ie(Xf,"u"),ie(ep,"c$1");var tp=ie((function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))}),"s");function np(e){var t=e.initialState,n=zf.NotStarted,r=new Set,i={_machine:e,send:function(i){n===zf.Running&&(t=e.transition(t,i),tp(t,Jf(i)),r.forEach((function(e){return e(t)})))},subscribe:function(e){return r.add(e),e(t),{unsubscribe:function(){return r.delete(e)}}},start:function(){return n=zf.Running,tp(t,Gf),i},stop:function(){return n=zf.Stopped,r.clear(),i},get state(){return t},get status(){return n}};return i}function rp(e){var t=(0,g.useRef)();return t.current||(t.current={v:e()}),t.current.v}function ip(){return ip=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}ie(dp,"useMachine"),ie(fp,"unwrapRefs"),ie(pp,"useCreateMachine"),ie(hp,"_extends$4"),ie(vp,"_objectWithoutPropertiesLoose$4"),(lp=ap||(ap={})).Idle="IDLE",lp.Open="OPEN",lp.Navigating="NAVIGATING",lp.Dragging="DRAGGING",lp.Interacting="INTERACTING",(up=sp||(sp={})).ButtonMouseDown="BUTTON_MOUSE_DOWN",up.ButtonMouseUp="BUTTON_MOUSE_UP",up.Blur="BLUR",up.ClearNavSelection="CLEAR_NAV_SELECTION",up.ClearTypeahead="CLEAR_TYPEAHEAD",up.GetDerivedData="GET_DERIVED_DATA",up.KeyDownEscape="KEY_DOWN_ESCAPE",up.KeyDownEnter="KEY_DOWN_ENTER",up.KeyDownSpace="KEY_DOWN_SPACE",up.KeyDownNavigate="KEY_DOWN_NAVIGATE",up.KeyDownSearch="KEY_DOWN_SEARCH",up.KeyDownTab="KEY_DOWN_TAB",up.KeyDownShiftTab="KEY_DOWN_SHIFT_TAB",up.OptionTouchStart="OPTION_TOUCH_START",up.OptionMouseMove="OPTION_MOUSE_MOVE",up.OptionMouseEnter="OPTION_MOUSE_ENTER",up.OptionMouseDown="OPTION_MOUSE_DOWN",up.OptionMouseUp="OPTION_MOUSE_UP",up.OptionClick="OPTION_CLICK",up.ListMouseUp="LIST_MOUSE_UP",up.OptionPress="OPTION_PRESS",up.OutsideMouseDown="OUTSIDE_MOUSE_DOWN",up.OutsideMouseUp="OUTSIDE_MOUSE_UP",up.ValueChange="VALUE_CHANGE",up.PopoverPointerDown="POPOVER_POINTER_DOWN",up.PopoverPointerUp="POPOVER_POINTER_UP",up.UpdateAfterTypeahead="UPDATE_AFTER_TYPEAHEAD";var mp=$f({navigationValue:null}),gp=$f({typeaheadQuery:null}),bp=$f({value:ie((function(e,t){return t.value}),"value")}),yp=$f({navigationValue:ie((function(e,t){return t.value}),"navigationValue")}),xp=$f({navigationValue:ie((function(e){var t,n=Lp(e.value,e.options);return n&&!n.disabled?e.value:(null==(t=e.options.find((function(e){return!e.disabled})))?void 0:t.value)||null}),"navigationValue")});function wp(e,t){if(t.type===sp.Blur){var n=t.refs,r=n.list,i=n.popover,o=t.relatedTarget,a=Xl(i);return!((null==a?void 0:a.activeElement)===r||!i||i.contains(o||(null==a?void 0:a.activeElement)))}return!1}function Cp(e,t){if(t.type===sp.OutsideMouseDown||t.type===sp.OutsideMouseUp){var n=t.refs,r=n.button,i=n.popover,o=t.relatedTarget;return!(o===r||!r||r.contains(o)||!i||i.contains(o))}return!1}function kp(e,t){return!!e.options.find((function(t){return t.value===e.navigationValue}))}function Ep(e,t){var n=t.refs,r=n.popover,i=n.list,o=t.relatedTarget;return!(r&&o&&r.contains(o)&&o!==i)&&kp(e)}function Sp(e,t){requestAnimationFrame((function(){t.refs.list&&t.refs.list.focus()}))}function Tp(e,t){t.refs.button&&t.refs.button.focus()}function _p(e,t){return!t.disabled}function Ip(e,t){return t.type!==sp.OptionTouchStart||!t||!t.disabled}function Rp(e,t){return(!("disabled"in t)||!t.disabled)&&("value"in t?null!=t.value:null!=e.navigationValue)}function Np(e,t){t.callback&&t.callback(t.value)}function Op(e,t){if(t.type===sp.KeyDownEnter){var n=t.refs.hiddenInput;if(n&&n.form){var r=n.form.querySelector("button:not([type]),[type='submit']");r&&r.click()}}}ie(wp,"listboxLostFocus"),ie(Cp,"clickedOutsideOfListbox"),ie(kp,"optionIsActive"),ie(Ep,"shouldNavigate"),ie(Sp,"focusList"),ie(Tp,"focusButton"),ie(_p,"listboxIsNotDisabled"),ie(Ip,"optionIsNavigable"),ie(Rp,"optionIsSelectable"),ie(Np,"selectOption"),ie(Op,"submitForm");var Mp=$f({typeaheadQuery:ie((function(e,t){return(e.typeaheadQuery||"")+t.query}),"typeaheadQuery")}),Pp=$f({value:ie((function(e,t){if(t.type===sp.UpdateAfterTypeahead&&t.query){var n=jp(e.options,t.query);if(n&&!n.disabled)return t.callback&&t.callback(n.value),n.value}return e.value}),"value")}),Dp=$f({navigationValue:ie((function(e,t){if(t.type===sp.UpdateAfterTypeahead&&t.query){var n=jp(e.options,t.query);if(n&&!n.disabled)return n.value}return e.navigationValue}),"navigationValue")}),Ap=((op={})[sp.GetDerivedData]={actions:$f((function(e,t){return hp({},e,t.data)}))},op[sp.ValueChange]={actions:[bp,Np]},op),Zp=ie((function(e){var t,n,r,i,o,a,l=e.value;return{id:"listbox",initial:ap.Idle,context:{value:l,options:[],navigationValue:null,typeaheadQuery:null},states:(a={},a[ap.Idle]={on:hp({},Ap,(t={},t[sp.ButtonMouseDown]={target:ap.Open,actions:[xp],cond:_p},t[sp.KeyDownSpace]={target:ap.Navigating,actions:[xp,Sp],cond:_p},t[sp.KeyDownSearch]={target:ap.Idle,actions:Mp,cond:_p},t[sp.UpdateAfterTypeahead]={target:ap.Idle,actions:[Pp],cond:_p},t[sp.ClearTypeahead]={target:ap.Idle,actions:gp},t[sp.KeyDownNavigate]={target:ap.Navigating,actions:[xp,gp,Sp],cond:_p},t[sp.KeyDownEnter]={actions:[Op],cond:_p},t))},a[ap.Interacting]={entry:[mp],on:hp({},Ap,(n={},n[sp.ClearNavSelection]={actions:[mp,Sp]},n[sp.KeyDownEnter]={target:ap.Idle,actions:[bp,gp,Tp,Np],cond:Rp},n[sp.KeyDownSpace]={target:ap.Idle,actions:[bp,gp,Tp,Np],cond:Rp},n[sp.ButtonMouseDown]={target:ap.Idle,actions:[Tp]},n[sp.KeyDownEscape]={target:ap.Idle,actions:[Tp]},n[sp.OptionMouseDown]={target:ap.Dragging},n[sp.OutsideMouseDown]=[{target:ap.Idle,cond:Cp,actions:gp},{target:ap.Dragging,actions:gp,cond:kp}],n[sp.OutsideMouseUp]=[{target:ap.Idle,cond:Cp,actions:gp},{target:ap.Navigating,cond:kp},{target:ap.Interacting,actions:gp}],n[sp.KeyDownEnter]=ap.Interacting,n[sp.Blur]=[{target:ap.Idle,cond:wp,actions:gp},{target:ap.Navigating,cond:Ep},{target:ap.Interacting,actions:gp}],n[sp.OptionTouchStart]={target:ap.Navigating,actions:[yp,gp],cond:Ip},n[sp.OptionClick]={target:ap.Idle,actions:[bp,gp,Tp,Np],cond:Rp},n[sp.OptionPress]={target:ap.Idle,actions:[bp,gp,Tp,Np],cond:Rp},n[sp.OptionMouseEnter]={target:ap.Navigating,actions:[yp,gp],cond:Ip},n[sp.KeyDownNavigate]={target:ap.Navigating,actions:[yp,gp,Sp]},n))},a[ap.Open]={on:hp({},Ap,(r={},r[sp.ClearNavSelection]={actions:[mp]},r[sp.KeyDownEnter]={target:ap.Idle,actions:[bp,gp,Tp,Np],cond:Rp},r[sp.KeyDownSpace]={target:ap.Idle,actions:[bp,gp,Tp,Np],cond:Rp},r[sp.ButtonMouseDown]={target:ap.Idle,actions:[Tp]},r[sp.KeyDownEscape]={target:ap.Idle,actions:[Tp]},r[sp.OptionMouseDown]={target:ap.Dragging},r[sp.OutsideMouseDown]=[{target:ap.Idle,cond:Cp,actions:gp},{target:ap.Dragging,cond:kp},{target:ap.Interacting,actions:gp}],r[sp.OutsideMouseUp]=[{target:ap.Idle,cond:Cp,actions:gp},{target:ap.Navigating,cond:kp},{target:ap.Interacting,actions:gp}],r[sp.Blur]=[{target:ap.Idle,cond:wp,actions:gp},{target:ap.Navigating,cond:Ep},{target:ap.Interacting,actions:gp}],r[sp.ButtonMouseUp]={target:ap.Navigating,actions:[xp,Sp]},r[sp.ListMouseUp]={target:ap.Navigating,actions:[xp,Sp]},r[sp.OptionTouchStart]={target:ap.Navigating,actions:[yp,gp],cond:Ip},r[sp.OptionClick]={target:ap.Idle,actions:[bp,gp,Tp,Np],cond:Rp},r[sp.OptionPress]={target:ap.Idle,actions:[bp,gp,Tp,Np],cond:Rp},r[sp.KeyDownNavigate]={target:ap.Navigating,actions:[yp,gp,Sp]},r[sp.KeyDownSearch]={target:ap.Navigating,actions:Mp},r[sp.UpdateAfterTypeahead]={actions:[Dp]},r[sp.ClearTypeahead]={actions:gp},r[sp.OptionMouseMove]=[{target:ap.Dragging,actions:[yp],cond:Ip},{target:ap.Dragging}],r))},a[ap.Dragging]={on:hp({},Ap,(i={},i[sp.ClearNavSelection]={actions:[mp]},i[sp.KeyDownEnter]={target:ap.Idle,actions:[bp,gp,Tp,Np],cond:Rp},i[sp.KeyDownSpace]={target:ap.Idle,actions:[bp,gp,Tp,Np],cond:Rp},i[sp.ButtonMouseDown]={target:ap.Idle,actions:[Tp]},i[sp.KeyDownEscape]={target:ap.Idle,actions:[Tp]},i[sp.OptionMouseDown]={target:ap.Dragging},i[sp.OutsideMouseDown]=[{target:ap.Idle,cond:Cp,actions:gp},{target:ap.Navigating,cond:kp},{target:ap.Interacting,actions:gp}],i[sp.OutsideMouseUp]=[{target:ap.Idle,cond:Cp,actions:gp},{target:ap.Navigating,cond:kp,actions:Sp},{target:ap.Interacting,actions:[gp,Sp]}],i[sp.Blur]=[{target:ap.Idle,cond:wp,actions:gp},{target:ap.Navigating,cond:Ep},{target:ap.Interacting,actions:gp}],i[sp.ButtonMouseUp]={target:ap.Navigating,actions:[xp,Sp]},i[sp.OptionTouchStart]={target:ap.Navigating,actions:[yp,gp],cond:Ip},i[sp.OptionClick]={target:ap.Idle,actions:[bp,gp,Tp,Np],cond:Rp},i[sp.OptionPress]={target:ap.Idle,actions:[bp,gp,Tp,Np],cond:Rp},i[sp.OptionMouseEnter]={target:ap.Dragging,actions:[yp,gp],cond:Ip},i[sp.KeyDownNavigate]={target:ap.Navigating,actions:[yp,gp,Sp]},i[sp.KeyDownSearch]={target:ap.Navigating,actions:Mp},i[sp.UpdateAfterTypeahead]={actions:[Dp]},i[sp.ClearTypeahead]={actions:gp},i[sp.OptionMouseMove]=[{target:ap.Navigating,actions:[yp],cond:Ip},{target:ap.Navigating}],i[sp.OptionMouseUp]={target:ap.Idle,actions:[bp,gp,Tp,Np],cond:Rp},i))},a[ap.Navigating]={on:hp({},Ap,(o={},o[sp.ClearNavSelection]={actions:[mp,Sp]},o[sp.KeyDownEnter]={target:ap.Idle,actions:[bp,gp,Tp,Np],cond:Rp},o[sp.KeyDownSpace]={target:ap.Idle,actions:[bp,gp,Tp,Np],cond:Rp},o[sp.ButtonMouseDown]={target:ap.Idle,actions:[Tp]},o[sp.KeyDownEscape]={target:ap.Idle,actions:[Tp]},o[sp.OptionMouseDown]={target:ap.Dragging},o[sp.OutsideMouseDown]=[{target:ap.Idle,cond:Cp,actions:gp},{target:ap.Navigating,cond:kp},{target:ap.Interacting,actions:gp}],o[sp.OutsideMouseUp]=[{target:ap.Idle,cond:Cp,actions:gp},{target:ap.Navigating,cond:kp},{target:ap.Interacting,actions:gp}],o[sp.Blur]=[{target:ap.Idle,cond:wp,actions:gp},{target:ap.Navigating,cond:Ep},{target:ap.Interacting,actions:gp}],o[sp.ButtonMouseUp]={target:ap.Navigating,actions:[xp,Sp]},o[sp.OptionTouchStart]={target:ap.Navigating,actions:[yp,gp],cond:Ip},o[sp.OptionClick]={target:ap.Idle,actions:[bp,gp,Tp,Np],cond:Rp},o[sp.OptionPress]={target:ap.Idle,actions:[bp,gp,Tp,Np],cond:Rp},o[sp.OptionMouseEnter]={target:ap.Navigating,actions:[yp,gp],cond:Ip},o[sp.KeyDownNavigate]={target:ap.Navigating,actions:[yp,gp,Sp]},o[sp.KeyDownSearch]={target:ap.Navigating,actions:Mp},o[sp.UpdateAfterTypeahead]={actions:[Dp]},o[sp.ClearTypeahead]={actions:gp},o[sp.OptionMouseMove]=[{target:ap.Navigating,actions:[yp],cond:Ip},{target:ap.Navigating}],o))},a)}}),"createMachineDefinition");function jp(e,t){return void 0===t&&(t=""),t&&e.find((function(e){return!e.disabled&&e.label&&e.label.toLowerCase().startsWith(t.toLowerCase())}))||null}function Lp(e,t){return e?t.find((function(t){return t.value===e})):void 0}ie(jp,"findOptionFromTypeahead"),ie(Lp,"findOptionFromValue");var Fp=["as","aria-labelledby","aria-label","children","defaultValue","disabled","form","name","onChange","required","value","__componentName"],zp=["arrow","button","children","portal"],Bp=["aria-label","arrow","as","children","onKeyDown","onMouseDown","onMouseUp"],Vp=["as","children"],Hp=["as","position","onBlur","onKeyDown","onMouseUp","portal","unstable_observableRefs"],Up=["as"],qp=["as","children","disabled","index","label","onClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseUp","onTouchStart","value"],Wp=Nf(),Gp=Hf(0,{}),Kp=(0,g.forwardRef)(ie((function(e,t){var n=e.as,r=void 0===n?"div":n,i=e["aria-labelledby"],o=e["aria-label"],a=e.children,l=e.defaultValue,s=e.disabled,u=void 0!==s&&s,c=e.form,d=e.name,f=e.onChange,p=e.required,h=e.value;e.__componentName;var v=vp(e,Fp),m=(0,g.useRef)(null!=h),b=Mf(),y=b[0],x=b[1],w=(0,g.useRef)(null),C=(0,g.useRef)(null),k=(0,g.useRef)(null),E=(0,g.useRef)(null),S=(0,g.useRef)(null),T=(0,g.useRef)(null),_=(0,g.useRef)(null),I=dp(pp(Zp({value:(m.current?h:l)||null})),{button:w,hiddenInput:C,highlightedOption:k,input:E,list:S,popover:T,selectedOption:_},false),R=I[0],N=I[1];function O(e){e!==R.context.value&&(null==f||f(e))}ie(O,"handleValueChange");var M=zd(v.id),P=v.id||qf("listbox-input",M),D=ss(E,t),A=(0,g.useMemo)((function(){var e=y.find((function(e){return e.value===R.context.value}));return e?e.label:null}),[y,R.context.value]),Z=ih(R.value),j={ariaLabel:o,ariaLabelledBy:i,buttonRef:w,disabled:u,highlightedOptionRef:k,isExpanded:Z,listboxId:P,listboxValueLabel:A,listRef:S,onValueChange:O,popoverRef:T,selectedOptionRef:_,send:N,state:R.value,stateData:R.context},L=(0,g.useRef)(!1);if(!m.current&&null==l&&!L.current&&y.length){L.current=!0;var F=y.find((function(e){return!e.disabled}));F&&F.value&&N({type:sp.ValueChange,value:F.value})}return sh(h,R.context.value,(function(){N({type:sp.ValueChange,value:h})})),Gl((function(){N({type:sp.GetDerivedData,data:{options:y}})}),[y,N]),(0,g.useEffect)((function(){function e(e){var t=e.target,n=e.relatedTarget;lh(T.current,t)||N({type:sp.OutsideMouseDown,relatedTarget:n||t})}return ie(e,"handleMouseDown"),Z&&window.addEventListener("mousedown",e),function(){window.removeEventListener("mousedown",e)}}),[N,Z]),(0,g.useEffect)((function(){function e(e){var t=e.target,n=e.relatedTarget;lh(T.current,t)||N({type:sp.OutsideMouseUp,relatedTarget:n||t})}return ie(e,"handleMouseUp"),Z&&window.addEventListener("mouseup",e),function(){window.removeEventListener("mouseup",e)}}),[N,Z]),(0,g.createElement)(r,hp({},v,{ref:D,"data-reach-listbox-input":"","data-state":Z?"expanded":"closed","data-value":R.context.value,id:P}),(0,g.createElement)(Gp.Provider,{value:j},(0,g.createElement)(Df,{context:Wp,items:y,set:x},ts(a)?a({id:P,isExpanded:Z,value:R.context.value,selectedOptionRef:_,highlightedOptionRef:k,valueLabel:A,expanded:Z}):a,(c||d||p)&&(0,g.createElement)("input",{ref:C,"data-reach-listbox-hidden-input":"",disabled:u,form:c,name:d,readOnly:!0,required:p,tabIndex:-1,type:"hidden",value:R.context.value||""}))))}),"ListboxInput")),$p=(0,g.forwardRef)(ie((function(e,t){var n=e.arrow,r=void 0===n?"\u25bc":n,i=e.button,o=e.children,a=e.portal,l=void 0===a||a,s=vp(e,zp);return(0,g.createElement)(Kp,hp({},s,{__componentName:"Listbox",ref:t}),(function(e){var t=e.value,n=e.valueLabel;return(0,g.createElement)(g.Fragment,null,(0,g.createElement)(Yp,{arrow:r,children:i?ts(i)?i({value:t,label:n}):i:void 0}),(0,g.createElement)(th,{portal:l},(0,g.createElement)(nh,null,o)))}))}),"Listbox")),Qp=(0,g.forwardRef)(ie((function(e,t){var n=e["aria-label"],r=e.arrow,i=void 0!==r&&r,o=e.as,a=void 0===o?"span":o,l=e.children,s=e.onKeyDown,u=e.onMouseDown,c=e.onMouseUp,d=vp(e,Bp),f=(0,g.useContext)(Gp),p=f.buttonRef,h=f.send,v=f.ariaLabelledBy,m=f.disabled,b=f.isExpanded,y=f.listboxId,x=f.stateData,w=f.listboxValueLabel,C=x.value,k=ss(p,t),E=oh();function S(e){Zf(e.nativeEvent)||(e.preventDefault(),e.stopPropagation(),h({type:sp.ButtonMouseDown,disabled:m}))}function T(e){Zf(e.nativeEvent)||(e.preventDefault(),e.stopPropagation(),h({type:sp.ButtonMouseUp}))}ie(S,"handleMouseDown"),ie(T,"handleMouseUp");var _=qf("button",y),I=(0,g.useMemo)((function(){return l?ts(l)?l({isExpanded:b,label:w,value:C,expanded:b}):l:w}),[l,w,b,C]);return(0,g.createElement)(a,hp({"aria-disabled":m||void 0,"aria-expanded":b||void 0,"aria-haspopup":"listbox","aria-labelledby":n?void 0:[v,_].filter(Boolean).join(" "),"aria-label":n,role:"button",tabIndex:m?-1:0},d,{ref:k,"data-reach-listbox-button":"",id:_,onKeyDown:us(s,E),onMouseDown:us(u,S),onMouseUp:us(c,T)}),I,i&&(0,g.createElement)(Xp,null,es(i)?null:i))}),"ListboxButton")),Yp=(0,g.memo)(Qp),Jp=(0,g.forwardRef)(ie((function(e,t){var n=e.as,r=void 0===n?"span":n,i=e.children,o=vp(e,Vp),a=(0,g.useContext)(Gp).isExpanded;return(0,g.createElement)(r,hp({"aria-hidden":!0},o,{ref:t,"data-reach-listbox-arrow":"","data-expanded":a?"":void 0}),ts(i)?i({isExpanded:a,expanded:a}):i||"\u25bc")}),"ListboxArrow")),Xp=(0,g.memo)(Jp),eh=(0,g.forwardRef)(ie((function(e,t){var n=e.as,r=void 0===n?"div":n,i=e.position,o=void 0===i?Ef:i,a=e.onBlur,l=e.onKeyDown,s=e.onMouseUp,u=e.portal,c=void 0===u||u,d=e.unstable_observableRefs,f=vp(e,Hp),p=(0,g.useContext)(Gp),h=p.isExpanded,v=p.buttonRef,m=p.popoverRef,b=p.send,y=ss(m,t),x=oh();function w(){b({type:sp.ListMouseUp})}ie(w,"handleMouseUp");var C=hp({hidden:!h,tabIndex:-1},f,{ref:y,"data-reach-listbox-popover":"",onMouseUp:us(s,w),onBlur:us(a,k),onKeyDown:us(l,x)});function k(e){var t=e.nativeEvent;requestAnimationFrame((function(){b({type:sp.Blur,relatedTarget:t.relatedTarget||t.target})}))}return ie(k,"handleBlur"),c?(0,g.createElement)(yf,hp({},C,{as:r,targetRef:v,position:o,unstable_observableRefs:d,unstable_skipInitialPortalRender:!0})):(0,g.createElement)(r,C)}),"ListboxPopover")),th=(0,g.memo)(eh),nh=(0,g.forwardRef)(ie((function(e,t){var n=e.as,r=void 0===n?"ul":n,i=vp(e,Up),o=(0,g.useContext)(Gp),a=o.listRef,l=o.ariaLabel,s=o.ariaLabelledBy,u=o.isExpanded,c=o.listboxId,d=o.stateData,f=d.value,p=d.navigationValue,h=ss(t,a);return(0,g.createElement)(r,hp({"aria-activedescendant":ah(u?p:f),"aria-labelledby":l?void 0:s,"aria-label":l,role:"listbox",tabIndex:-1},i,{ref:h,"data-reach-listbox-list":"",id:qf("listbox",c)}))}),"ListboxList")),rh=(0,g.forwardRef)(ie((function(e,t){var n=e.as,r=void 0===n?"li":n,i=e.children,o=e.disabled,a=e.index,l=e.label,s=e.onClick,u=e.onMouseDown,c=e.onMouseEnter,d=e.onMouseLeave,f=e.onMouseMove,p=e.onMouseUp,h=e.onTouchStart,v=e.value,m=vp(e,qp),b=(0,g.useContext)(Gp),y=b.highlightedOptionRef,x=b.selectedOptionRef,w=b.send,C=b.isExpanded,k=b.onValueChange,E=b.state,S=b.stateData,T=S.value,_=S.navigationValue,I=(0,g.useState)(l),R=I[0],N=I[1],O=l||R||"",M=Wf((0,g.useRef)(null),null),P=M[0],D=M[1];Of((0,g.useMemo)((function(){return{element:P,value:v,label:O,disabled:!!o}}),[o,P,O,v]),Wp,a);var A=(0,g.useCallback)((function(e){!l&&e&&N((function(t){return e.textContent&&t!==e.textContent?e.textContent:t||""}))}),[l]),Z=!!_&&_===v,j=T===v,L=ss(A,t,D,j?x:null,Z?y:null);function F(){w({type:sp.OptionMouseEnter,value:v,disabled:!!o})}function z(){w({type:sp.OptionTouchStart,value:v,disabled:!!o})}function B(){w({type:sp.ClearNavSelection})}function V(e){Zf(e.nativeEvent)||(e.preventDefault(),w({type:sp.OptionMouseDown}))}function H(e){Zf(e.nativeEvent)||w({type:sp.OptionMouseUp,value:v,callback:k,disabled:!!o})}function U(e){Zf(e.nativeEvent)||w({type:sp.OptionClick,value:v,callback:k,disabled:!!o})}function q(){E!==ap.Open&&_===v||w({type:sp.OptionMouseMove,value:v,disabled:!!o})}return ie(F,"handleMouseEnter"),ie(z,"handleTouchStart"),ie(B,"handleMouseLeave"),ie(V,"handleMouseDown"),ie(H,"handleMouseUp"),ie(U,"handleClick"),ie(q,"handleMouseMove"),(0,g.createElement)(r,hp({"aria-selected":(C?Z:j)||void 0,"aria-disabled":o||void 0,role:"option"},m,{ref:L,id:ah(v),"data-reach-listbox-option":"","data-current-nav":Z?"":void 0,"data-current-selected":j?"":void 0,"data-label":O,"data-value":v,onClick:us(s,U),onMouseDown:us(u,V),onMouseEnter:us(c,F),onMouseLeave:us(d,B),onMouseMove:us(f,q),onMouseUp:us(p,H),onTouchStart:us(h,z)}),i)}),"ListboxOption"));function ih(e){return[ap.Navigating,ap.Open,ap.Dragging,ap.Interacting].includes(e)}function oh(){var e=(0,g.useContext)(Gp),t=e.send,n=e.disabled,r=e.onValueChange,i=e.stateData,o=i.navigationValue,a=i.typeaheadQuery,l=Pf(Wp),s=Lf(r);(0,g.useEffect)((function(){a&&t({type:sp.UpdateAfterTypeahead,query:a,callback:s});var e=window.setTimeout((function(){null!=a&&t({type:sp.ClearTypeahead})}),1e3);return function(){window.clearTimeout(e)}}),[s,t,a]);var u=l.findIndex((function(e){return e.value===o}));return us((function(e){var i=e.key,a=ns(i)&&1===i.length,s=l.find((function(e){return e.value===o}));switch(i){case"Enter":return void t({type:sp.KeyDownEnter,value:o,callback:r,disabled:!!(null!=s&&s.disabled||n)});case" ":return e.preventDefault(),void t({type:sp.KeyDownSpace,value:o,callback:r,disabled:!!(null!=s&&s.disabled||n)});case"Escape":return void t({type:sp.KeyDownEscape});case"Tab":var u=e.shiftKey?sp.KeyDownShiftTab:sp.KeyDownTab;return void t({type:u});default:return void(a&&t({type:sp.KeyDownSearch,query:i,disabled:n}))}}),Af(Wp,{currentIndex:u,orientation:"vertical",key:"index",rotate:!0,filter:ie((function(e){return!e.disabled}),"filter"),callback:ie((function(e){t({type:sp.KeyDownNavigate,value:l[e].value,disabled:n})}),"callback")}))}function ah(e){var t=(0,g.useContext)(Gp).listboxId;return e?qf("option-"+e,t):void 0}function lh(e,t){return!(!e||!e.contains(t))}function sh(e,t,n){(0,g.useRef)(null!=e).current&&e!==t&&n()}function uh(e){var t=(0,g.useRef)(null);return(0,g.useEffect)((function(){t.current=e}),[e]),t.current}function ch(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}function dh(){return dh=Object.assign||function(e){for(var t=1;t8||n>8)&&(C.current=!0)}L||null==j||f||y({type:Ch,payload:{index:j,dropdownRef:x}})}function G(){C.current=!0,L||null==j||f||y({type:Ch,payload:{index:j}})}function K(e){Zf(e.nativeEvent)||(C.current?r?P.current?P.current=!1:I.current&&I.current.click():f||z():C.current=!0)}return k.current[j]=d,ie(z,"select"),ie(B,"handleClick"),ie(V,"handleDragStart"),ie(H,"handleMouseDown"),ie(U,"handleMouseEnter"),ie(q,"handleMouseLeave"),ie(W,"handleMouseMove"),ie(G,"handleFocus"),ie(K,"handleMouseUp"),(0,g.useEffect)((function(){if(_){var e=window.setTimeout((function(){C.current=!0}),400);return function(){window.clearTimeout(e)}}C.current=!1}),[_,C]),(0,g.useEffect)((function(){var e=Xl(I.current);return e.addEventListener("mouseup",t),function(){e.removeEventListener("mouseup",t)};function t(){P.current=!1}}),[]),{data:{disabled:f},props:dh({id:Ah(j),tabIndex:-1},m,{ref:F,"data-disabled":f?"":void 0,"data-selected":L?"":void 0,"data-valuetext":N,onClick:us(i,B),onDragStart:us(o,V),onMouseDown:us(a,H),onMouseEnter:us(l,U),onMouseLeave:us(s,q),onMouseMove:us(u,W),onFocus:us(p,G),onMouseUp:us(c,K)})}}function Mh(e){e.id;var t=e.onKeyDown,n=e.ref,r=ch(e,hh),i=_h("useDropdownItems"),o=i.dispatch,a=i.triggerRef,l=i.dropdownRef,s=i.selectCallbacks,u=i.dropdownId,c=i.state,d=c.isExpanded,f=c.triggerId,p=c.selectionIndex,h=c.typeaheadQuery,v=Fh(),m=ss(l,n);(0,g.useEffect)((function(){var e=Dh(v,h);h&&null!=e&&o({type:Ch,payload:{index:e,dropdownRef:l}});var t=window.setTimeout((function(){return h&&o({type:wh,payload:""})}),1e3);return function(){return window.clearTimeout(t)}}),[o,v,h,l]);var b=uh(v.length),y=uh(v[p]),x=uh(p);(0,g.useEffect)((function(){p>v.length-1?o({type:Ch,payload:{index:v.length-1,dropdownRef:l}}):b!==v.length&&p>-1&&y&&x===p&&v[p]!==y&&o({type:Ch,payload:{index:v.findIndex((function(e){return e.key===(null==y?void 0:y.key)})),dropdownRef:l}})}),[l,o,v,b,y,x,p]);var w=us(ie((function(e){var t=e.key;if(d)switch(t){case"Enter":case" ":var n=v.find((function(e){return e.index===p}));n&&!n.disabled&&(e.preventDefault(),n.isLink&&n.element?n.element.click():(Zh(a.current),s.current[n.index]&&s.current[n.index](),o({type:gh})));break;case"Escape":Zh(a.current),o({type:bh});break;case"Tab":e.preventDefault();break;default:if(ns(t)&&1===t.length){var r=h+t.toLowerCase();o({type:wh,payload:r})}}}),"handleKeyDown"),Af(Eh,{currentIndex:p,orientation:"vertical",rotate:!1,filter:ie((function(e){return!e.disabled}),"filter"),callback:ie((function(e){o({type:Ch,payload:{index:e,dropdownRef:l}})}),"callback"),key:"index"}));return{data:{activeDescendant:Ah(p)||void 0,triggerId:f},props:dh({tabIndex:-1},r,{ref:m,id:u,onKeyDown:us(t,w)})}}function Ph(e){var t=e.onBlur,n=e.portal,r=void 0===n||n,i=e.position,o=e.ref,a=ch(e,vh),l=_h("useDropdownPopover"),s=l.triggerRef,u=l.triggerClickedRef,c=l.dispatch,d=l.dropdownRef,f=l.popoverRef,p=l.state.isExpanded,h=ss(f,o);return(0,g.useEffect)((function(){if(p){var e=Xl(f.current);return ie(t,"listener"),e.addEventListener("mousedown",t),function(){e.removeEventListener("mousedown",t)}}function t(e){u.current?u.current=!1:jh(f.current,e.target)||c({type:bh})}}),[u,s,c,d,f,p]),{data:{portal:r,position:i,targetRef:s,isExpanded:p},props:dh({ref:h,hidden:!p,onBlur:us(t,(function(e){e.currentTarget.contains(e.relatedTarget)||c({type:bh})}))},a)}}function Dh(e,t){if(void 0===t&&(t=""),!t)return null;var n=e.find((function(e){var n,r,i;return!e.disabled&&(null==(n=e.element)||null==(r=n.dataset)||null==(i=r.valuetext)?void 0:i.toLowerCase().startsWith(t))}));return n?e.indexOf(n):null}function Ah(e){var t=_h("useItemId").dropdownId;return null!=e&&e>-1?qf("option-"+e,t):void 0}function Zh(e){e&&e.focus()}function jh(e,t){return!(!e||!e.contains(t))}function Lh(e,t){switch(void 0===t&&(t={}),t.type){case gh:case bh:return dh({},e,{isExpanded:!1,selectionIndex:-1});case"OPEN_MENU_AT_FIRST_ITEM":return dh({},e,{isExpanded:!0,selectionIndex:0});case yh:return dh({},e,{isExpanded:!0,selectionIndex:t.payload.index});case xh:return dh({},e,{isExpanded:!0,selectionIndex:-1});case Ch:var n=t.payload.dropdownRef,r=void 0===n?{current:null}:n;if(t.payload.index>=0&&t.payload.index!==e.selectionIndex){if(r.current){var i=Xl(r.current);r.current!==(null==i?void 0:i.activeElement)&&r.current.focus()}return dh({},e,{selectionIndex:null!=t.payload.max?Math.min(Math.max(t.payload.index,0),t.payload.max):Math.max(t.payload.index,0)})}return e;case mh:return dh({},e,{selectionIndex:-1});case kh:return dh({},e,{triggerId:t.payload});case wh:return"undefined"!==typeof t.payload?dh({},e,{typeaheadQuery:t.payload}):e;default:return e}}function Fh(){return Pf(Eh)}ie(Nh,"useDropdownTrigger"),ie(Oh,"useDropdownItem"),ie(Mh,"useDropdownItems"),ie(Ph,"useDropdownPopover"),ie(Dh,"findItemFromTypeahead"),ie(Ah,"useItemId"),ie(Zh,"focus"),ie(jh,"popoverContainsEventTarget"),ie(Lh,"reducer$1"),ie(Fh,"useDropdownDescendants");var zh={exports:{}},Bh={},Vh="function"===typeof Symbol&&Symbol.for,Hh=Vh?Symbol.for("react.element"):60103,Uh=Vh?Symbol.for("react.portal"):60106,qh=Vh?Symbol.for("react.fragment"):60107,Wh=Vh?Symbol.for("react.strict_mode"):60108,Gh=Vh?Symbol.for("react.profiler"):60114,Kh=Vh?Symbol.for("react.provider"):60109,$h=Vh?Symbol.for("react.context"):60110,Qh=Vh?Symbol.for("react.async_mode"):60111,Yh=Vh?Symbol.for("react.concurrent_mode"):60111,Jh=Vh?Symbol.for("react.forward_ref"):60112,Xh=Vh?Symbol.for("react.suspense"):60113,ev=Vh?Symbol.for("react.suspense_list"):60120,tv=Vh?Symbol.for("react.memo"):60115,nv=Vh?Symbol.for("react.lazy"):60116,rv=Vh?Symbol.for("react.block"):60121,iv=Vh?Symbol.for("react.fundamental"):60117,ov=Vh?Symbol.for("react.responder"):60118,av=Vh?Symbol.for("react.scope"):60119;function lv(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case Hh:switch(e=e.type){case Qh:case Yh:case qh:case Gh:case Wh:case Xh:return e;default:switch(e=e&&e.$$typeof){case $h:case Jh:case nv:case tv:case Kh:return e;default:return t}}case Uh:return t}}}function sv(e){return lv(e)===Yh}function uv(){return uv=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}ie(lv,"z"),ie(sv,"A"),Bh.AsyncMode=Qh,Bh.ConcurrentMode=Yh,Bh.ContextConsumer=$h,Bh.ContextProvider=Kh,Bh.Element=Hh,Bh.ForwardRef=Jh,Bh.Fragment=qh,Bh.Lazy=nv,Bh.Memo=tv,Bh.Portal=Uh,Bh.Profiler=Gh,Bh.StrictMode=Wh,Bh.Suspense=Xh,Bh.isAsyncMode=function(e){return sv(e)||lv(e)===Qh},Bh.isConcurrentMode=sv,Bh.isContextConsumer=function(e){return lv(e)===$h},Bh.isContextProvider=function(e){return lv(e)===Kh},Bh.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===Hh},Bh.isForwardRef=function(e){return lv(e)===Jh},Bh.isFragment=function(e){return lv(e)===qh},Bh.isLazy=function(e){return lv(e)===nv},Bh.isMemo=function(e){return lv(e)===tv},Bh.isPortal=function(e){return lv(e)===Uh},Bh.isProfiler=function(e){return lv(e)===Gh},Bh.isStrictMode=function(e){return lv(e)===Wh},Bh.isSuspense=function(e){return lv(e)===Xh},Bh.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===qh||e===Yh||e===Gh||e===Wh||e===Xh||e===ev||"object"===typeof e&&null!==e&&(e.$$typeof===nv||e.$$typeof===tv||e.$$typeof===Kh||e.$$typeof===$h||e.$$typeof===Jh||e.$$typeof===iv||e.$$typeof===ov||e.$$typeof===av||e.$$typeof===rv)},Bh.typeOf=lv,zh.exports=Bh,ie(uv,"_extends$2"),ie(cv,"_objectWithoutPropertiesLoose$2");var dv=["as","id","children"],fv=["as"],pv=["as"],hv=["as"],vv=["as"],mv=["portal"],gv=["as"],bv=(0,g.forwardRef)((function(e,t){var n=e.as,r=void 0===n?g.Fragment:n,i=e.id,o=e.children,a=cv(e,dv),l=(0,g.useMemo)((function(){try{return zh.exports.isFragment((0,g.createElement)(r,null))}catch(TS){return!1}}),[r])?{}:uv({ref:t,id:i,"data-reach-menu":""},a);return(0,g.createElement)(r,l,(0,g.createElement)(Rh,{id:i,children:o}))})),yv=(0,g.forwardRef)((function(e,t){var n=e.as,r=void 0===n?"button":n,i=Nh(uv({},cv(e,fv),{ref:t})),o=i.data,a=o.isExpanded,l=o.controls,s=i.props;return(0,g.createElement)(r,uv({"aria-expanded":!!a||void 0,"aria-haspopup":!0,"aria-controls":l},s,{"data-reach-menu-button":""}))})),xv=(0,g.forwardRef)((function(e,t){var n=e.as,r=void 0===n?"div":n,i=Oh(uv({},cv(e,pv),{ref:t})),o=i.data.disabled,a=i.props;return(0,g.createElement)(r,uv({role:"menuitem"},a,{"aria-disabled":o||void 0,"data-reach-menu-item":""}))})),wv=(0,g.forwardRef)((function(e,t){var n=e.as,r=void 0===n?"div":n,i=cv(e,hv);return(0,g.createElement)(xv,uv({},i,{ref:t,as:r}))})),Cv=(0,g.forwardRef)((function(e,t){var n=e.as,r=void 0===n?"div":n,i=Mh(uv({},cv(e,vv),{ref:t})),o=i.data,a=o.activeDescendant,l=o.triggerId,s=i.props;return(0,g.createElement)(r,uv({"aria-activedescendant":a,"aria-labelledby":l||void 0,role:"menu"},s,{"data-reach-menu-items":""}))})),kv=(0,g.forwardRef)((function(e,t){var n=e.portal,r=void 0===n||n,i=cv(e,mv);return(0,g.createElement)(Ev,{portal:r},(0,g.createElement)(Cv,uv({},i,{ref:t,"data-reach-menu-list":""})))})),Ev=(0,g.forwardRef)((function(e,t){var n=e.as,r=void 0===n?"div":n,i=Ph(uv({},cv(e,gv),{ref:t})),o=i.data,a=o.portal,l=o.targetRef,s=o.position,u=i.props,c={"data-reach-menu-popover":""};return a?(0,g.createElement)(yf,uv({},u,c,{as:r,targetRef:l,position:s,unstable_skipInitialPortalRender:!0})):(0,g.createElement)(r,uv({},u,c))})),Sv=(0,g.forwardRef)((function(e,t){return Xe(yv,re(ne({},e),{ref:t,className:le("graphiql-un-styled",e.className)}))}));Sv.displayName="MenuButton";var Tv=Pd(bv,{Button:Sv,Item:wv,List:kv}),_v=(0,g.forwardRef)((function(e,t){return Xe(Yp,re(ne({},e),{ref:t,className:le("graphiql-un-styled",e.className)}))}));_v.displayName="ListboxButton";var Iv=Pd($p,{Button:_v,Input:Kp,Option:rh,Popover:th}),Rv={},Nv={Aacute:"\xc1",aacute:"\xe1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223e",acd:"\u223f",acE:"\u223e\u0333",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",Acy:"\u0410",acy:"\u0430",AElig:"\xc6",aelig:"\xe6",af:"\u2061",Afr:"\ud835\udd04",afr:"\ud835\udd1e",Agrave:"\xc0",agrave:"\xe0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03b1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2a3f",amp:"&",AMP:"&",andand:"\u2a55",And:"\u2a53",and:"\u2227",andd:"\u2a5c",andslope:"\u2a58",andv:"\u2a5a",ang:"\u2220",ange:"\u29a4",angle:"\u2220",angmsdaa:"\u29a8",angmsdab:"\u29a9",angmsdac:"\u29aa",angmsdad:"\u29ab",angmsdae:"\u29ac",angmsdaf:"\u29ad",angmsdag:"\u29ae",angmsdah:"\u29af",angmsd:"\u2221",angrt:"\u221f",angrtvb:"\u22be",angrtvbd:"\u299d",angsph:"\u2222",angst:"\xc5",angzarr:"\u237c",Aogon:"\u0104",aogon:"\u0105",Aopf:"\ud835\udd38",aopf:"\ud835\udd52",apacir:"\u2a6f",ap:"\u2248",apE:"\u2a70",ape:"\u224a",apid:"\u224b",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224a",Aring:"\xc5",aring:"\xe5",Ascr:"\ud835\udc9c",ascr:"\ud835\udcb6",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224d",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",awconint:"\u2233",awint:"\u2a11",backcong:"\u224c",backepsilon:"\u03f6",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",Backslash:"\u2216",Barv:"\u2ae7",barvee:"\u22bd",barwed:"\u2305",Barwed:"\u2306",barwedge:"\u2305",bbrk:"\u23b5",bbrktbrk:"\u23b6",bcong:"\u224c",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201e",becaus:"\u2235",because:"\u2235",Because:"\u2235",bemptyv:"\u29b0",bepsi:"\u03f6",bernou:"\u212c",Bernoullis:"\u212c",Beta:"\u0392",beta:"\u03b2",beth:"\u2136",between:"\u226c",Bfr:"\ud835\udd05",bfr:"\ud835\udd1f",bigcap:"\u22c2",bigcirc:"\u25ef",bigcup:"\u22c3",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",bigvee:"\u22c1",bigwedge:"\u22c0",bkarow:"\u290d",blacklozenge:"\u29eb",blacksquare:"\u25aa",blacktriangle:"\u25b4",blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20e5",bnequiv:"\u2261\u20e5",bNot:"\u2aed",bnot:"\u2310",Bopf:"\ud835\udd39",bopf:"\ud835\udd53",bot:"\u22a5",bottom:"\u22a5",bowtie:"\u22c8",boxbox:"\u29c9",boxdl:"\u2510",boxdL:"\u2555",boxDl:"\u2556",boxDL:"\u2557",boxdr:"\u250c",boxdR:"\u2552",boxDr:"\u2553",boxDR:"\u2554",boxh:"\u2500",boxH:"\u2550",boxhd:"\u252c",boxHd:"\u2564",boxhD:"\u2565",boxHD:"\u2566",boxhu:"\u2534",boxHu:"\u2567",boxhU:"\u2568",boxHU:"\u2569",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxul:"\u2518",boxuL:"\u255b",boxUl:"\u255c",boxUL:"\u255d",boxur:"\u2514",boxuR:"\u2558",boxUr:"\u2559",boxUR:"\u255a",boxv:"\u2502",boxV:"\u2551",boxvh:"\u253c",boxvH:"\u256a",boxVh:"\u256b",boxVH:"\u256c",boxvl:"\u2524",boxvL:"\u2561",boxVl:"\u2562",boxVL:"\u2563",boxvr:"\u251c",boxvR:"\u255e",boxVr:"\u255f",boxVR:"\u2560",bprime:"\u2035",breve:"\u02d8",Breve:"\u02d8",brvbar:"\xa6",bscr:"\ud835\udcb7",Bscr:"\u212c",bsemi:"\u204f",bsim:"\u223d",bsime:"\u22cd",bsolb:"\u29c5",bsol:"\\",bsolhsub:"\u27c8",bull:"\u2022",bullet:"\u2022",bump:"\u224e",bumpE:"\u2aae",bumpe:"\u224f",Bumpeq:"\u224e",bumpeq:"\u224f",Cacute:"\u0106",cacute:"\u0107",capand:"\u2a44",capbrcup:"\u2a49",capcap:"\u2a4b",cap:"\u2229",Cap:"\u22d2",capcup:"\u2a47",capdot:"\u2a40",CapitalDifferentialD:"\u2145",caps:"\u2229\ufe00",caret:"\u2041",caron:"\u02c7",Cayleys:"\u212d",ccaps:"\u2a4d",Ccaron:"\u010c",ccaron:"\u010d",Ccedil:"\xc7",ccedil:"\xe7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2a4c",ccupssm:"\u2a50",Cdot:"\u010a",cdot:"\u010b",cedil:"\xb8",Cedilla:"\xb8",cemptyv:"\u29b2",cent:"\xa2",centerdot:"\xb7",CenterDot:"\xb7",cfr:"\ud835\udd20",Cfr:"\u212d",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03a7",chi:"\u03c7",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledast:"\u229b",circledcirc:"\u229a",circleddash:"\u229d",CircleDot:"\u2299",circledR:"\xae",circledS:"\u24c8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cir:"\u25cb",cirE:"\u29c3",cire:"\u2257",cirfnint:"\u2a10",cirmid:"\u2aef",cirscir:"\u29c2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201d",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",colon:":",Colon:"\u2237",Colone:"\u2a74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2a6d",Congruent:"\u2261",conint:"\u222e",Conint:"\u222f",ContourIntegral:"\u222e",copf:"\ud835\udd54",Copf:"\u2102",coprod:"\u2210",Coproduct:"\u2210",copy:"\xa9",COPY:"\xa9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21b5",cross:"\u2717",Cross:"\u2a2f",Cscr:"\ud835\udc9e",cscr:"\ud835\udcb8",csub:"\u2acf",csube:"\u2ad1",csup:"\u2ad0",csupe:"\u2ad2",ctdot:"\u22ef",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22de",cuesc:"\u22df",cularr:"\u21b6",cularrp:"\u293d",cupbrcap:"\u2a48",cupcap:"\u2a46",CupCap:"\u224d",cup:"\u222a",Cup:"\u22d3",cupcup:"\u2a4a",cupdot:"\u228d",cupor:"\u2a45",cups:"\u222a\ufe00",curarr:"\u21b7",curarrm:"\u293c",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",curlyvee:"\u22ce",curlywedge:"\u22cf",curren:"\xa4",curvearrowleft:"\u21b6",curvearrowright:"\u21b7",cuvee:"\u22ce",cuwed:"\u22cf",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232d",dagger:"\u2020",Dagger:"\u2021",daleth:"\u2138",darr:"\u2193",Darr:"\u21a1",dArr:"\u21d3",dash:"\u2010",Dashv:"\u2ae4",dashv:"\u22a3",dbkarow:"\u290f",dblac:"\u02dd",Dcaron:"\u010e",dcaron:"\u010f",Dcy:"\u0414",dcy:"\u0434",ddagger:"\u2021",ddarr:"\u21ca",DD:"\u2145",dd:"\u2146",DDotrahd:"\u2911",ddotseq:"\u2a77",deg:"\xb0",Del:"\u2207",Delta:"\u0394",delta:"\u03b4",demptyv:"\u29b1",dfisht:"\u297f",Dfr:"\ud835\udd07",dfr:"\ud835\udd21",dHar:"\u2965",dharl:"\u21c3",dharr:"\u21c2",DiacriticalAcute:"\xb4",DiacriticalDot:"\u02d9",DiacriticalDoubleAcute:"\u02dd",DiacriticalGrave:"`",DiacriticalTilde:"\u02dc",diam:"\u22c4",diamond:"\u22c4",Diamond:"\u22c4",diamondsuit:"\u2666",diams:"\u2666",die:"\xa8",DifferentialD:"\u2146",digamma:"\u03dd",disin:"\u22f2",div:"\xf7",divide:"\xf7",divideontimes:"\u22c7",divonx:"\u22c7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231e",dlcrop:"\u230d",dollar:"$",Dopf:"\ud835\udd3b",dopf:"\ud835\udd55",Dot:"\xa8",dot:"\u02d9",DotDot:"\u20dc",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22a1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222f",DoubleDot:"\xa8",DoubleDownArrow:"\u21d3",DoubleLeftArrow:"\u21d0",DoubleLeftRightArrow:"\u21d4",DoubleLeftTee:"\u2ae4",DoubleLongLeftArrow:"\u27f8",DoubleLongLeftRightArrow:"\u27fa",DoubleLongRightArrow:"\u27f9",DoubleRightArrow:"\u21d2",DoubleRightTee:"\u22a8",DoubleUpArrow:"\u21d1",DoubleUpDownArrow:"\u21d5",DoubleVerticalBar:"\u2225",DownArrowBar:"\u2913",downarrow:"\u2193",DownArrow:"\u2193",Downarrow:"\u21d3",DownArrowUpArrow:"\u21f5",DownBreve:"\u0311",downdownarrows:"\u21ca",downharpoonleft:"\u21c3",downharpoonright:"\u21c2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295e",DownLeftVectorBar:"\u2956",DownLeftVector:"\u21bd",DownRightTeeVector:"\u295f",DownRightVectorBar:"\u2957",DownRightVector:"\u21c1",DownTeeArrow:"\u21a7",DownTee:"\u22a4",drbkarow:"\u2910",drcorn:"\u231f",drcrop:"\u230c",Dscr:"\ud835\udc9f",dscr:"\ud835\udcb9",DScy:"\u0405",dscy:"\u0455",dsol:"\u29f6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22f1",dtri:"\u25bf",dtrif:"\u25be",duarr:"\u21f5",duhar:"\u296f",dwangle:"\u29a6",DZcy:"\u040f",dzcy:"\u045f",dzigrarr:"\u27ff",Eacute:"\xc9",eacute:"\xe9",easter:"\u2a6e",Ecaron:"\u011a",ecaron:"\u011b",Ecirc:"\xca",ecirc:"\xea",ecir:"\u2256",ecolon:"\u2255",Ecy:"\u042d",ecy:"\u044d",eDDot:"\u2a77",Edot:"\u0116",edot:"\u0117",eDot:"\u2251",ee:"\u2147",efDot:"\u2252",Efr:"\ud835\udd08",efr:"\ud835\udd22",eg:"\u2a9a",Egrave:"\xc8",egrave:"\xe8",egs:"\u2a96",egsdot:"\u2a98",el:"\u2a99",Element:"\u2208",elinters:"\u23e7",ell:"\u2113",els:"\u2a95",elsdot:"\u2a97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25fb",emptyv:"\u2205",EmptyVerySmallSquare:"\u25ab",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",ENG:"\u014a",eng:"\u014b",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\ud835\udd3c",eopf:"\ud835\udd56",epar:"\u22d5",eparsl:"\u29e3",eplus:"\u2a71",epsi:"\u03b5",Epsilon:"\u0395",epsilon:"\u03b5",epsiv:"\u03f5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2a96",eqslantless:"\u2a95",Equal:"\u2a75",equals:"=",EqualTilde:"\u2242",equest:"\u225f",Equilibrium:"\u21cc",equiv:"\u2261",equivDD:"\u2a78",eqvparsl:"\u29e5",erarr:"\u2971",erDot:"\u2253",escr:"\u212f",Escr:"\u2130",esdot:"\u2250",Esim:"\u2a73",esim:"\u2242",Eta:"\u0397",eta:"\u03b7",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",euro:"\u20ac",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",exponentiale:"\u2147",ExponentialE:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\ufb03",fflig:"\ufb00",ffllig:"\ufb04",Ffr:"\ud835\udd09",ffr:"\ud835\udd23",filig:"\ufb01",FilledSmallSquare:"\u25fc",FilledVerySmallSquare:"\u25aa",fjlig:"fj",flat:"\u266d",fllig:"\ufb02",fltns:"\u25b1",fnof:"\u0192",Fopf:"\ud835\udd3d",fopf:"\ud835\udd57",forall:"\u2200",ForAll:"\u2200",fork:"\u22d4",forkv:"\u2ad9",Fouriertrf:"\u2131",fpartint:"\u2a0d",frac12:"\xbd",frac13:"\u2153",frac14:"\xbc",frac15:"\u2155",frac16:"\u2159",frac18:"\u215b",frac23:"\u2154",frac25:"\u2156",frac34:"\xbe",frac35:"\u2157",frac38:"\u215c",frac45:"\u2158",frac56:"\u215a",frac58:"\u215d",frac78:"\u215e",frasl:"\u2044",frown:"\u2322",fscr:"\ud835\udcbb",Fscr:"\u2131",gacute:"\u01f5",Gamma:"\u0393",gamma:"\u03b3",Gammad:"\u03dc",gammad:"\u03dd",gap:"\u2a86",Gbreve:"\u011e",gbreve:"\u011f",Gcedil:"\u0122",Gcirc:"\u011c",gcirc:"\u011d",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",ge:"\u2265",gE:"\u2267",gEl:"\u2a8c",gel:"\u22db",geq:"\u2265",geqq:"\u2267",geqslant:"\u2a7e",gescc:"\u2aa9",ges:"\u2a7e",gesdot:"\u2a80",gesdoto:"\u2a82",gesdotol:"\u2a84",gesl:"\u22db\ufe00",gesles:"\u2a94",Gfr:"\ud835\udd0a",gfr:"\ud835\udd24",gg:"\u226b",Gg:"\u22d9",ggg:"\u22d9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gla:"\u2aa5",gl:"\u2277",glE:"\u2a92",glj:"\u2aa4",gnap:"\u2a8a",gnapprox:"\u2a8a",gne:"\u2a88",gnE:"\u2269",gneq:"\u2a88",gneqq:"\u2269",gnsim:"\u22e7",Gopf:"\ud835\udd3e",gopf:"\ud835\udd58",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterGreater:"\u2aa2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Gscr:"\ud835\udca2",gscr:"\u210a",gsim:"\u2273",gsime:"\u2a8e",gsiml:"\u2a90",gtcc:"\u2aa7",gtcir:"\u2a7a",gt:">",GT:">",Gt:"\u226b",gtdot:"\u22d7",gtlPar:"\u2995",gtquest:"\u2a7c",gtrapprox:"\u2a86",gtrarr:"\u2978",gtrdot:"\u22d7",gtreqless:"\u22db",gtreqqless:"\u2a8c",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\ufe00",gvnE:"\u2269\ufe00",Hacek:"\u02c7",hairsp:"\u200a",half:"\xbd",hamilt:"\u210b",HARDcy:"\u042a",hardcy:"\u044a",harrcir:"\u2948",harr:"\u2194",hArr:"\u21d4",harrw:"\u21ad",Hat:"^",hbar:"\u210f",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22b9",hfr:"\ud835\udd25",Hfr:"\u210c",HilbertSpace:"\u210b",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21ff",homtht:"\u223b",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",hopf:"\ud835\udd59",Hopf:"\u210d",horbar:"\u2015",HorizontalLine:"\u2500",hscr:"\ud835\udcbd",Hscr:"\u210b",hslash:"\u210f",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224e",HumpEqual:"\u224f",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xcd",iacute:"\xed",ic:"\u2063",Icirc:"\xce",icirc:"\xee",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xa1",iff:"\u21d4",ifr:"\ud835\udd26",Ifr:"\u2111",Igrave:"\xcc",igrave:"\xec",ii:"\u2148",iiiint:"\u2a0c",iiint:"\u222d",iinfin:"\u29dc",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Imacr:"\u012a",imacr:"\u012b",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",Im:"\u2111",imof:"\u22b7",imped:"\u01b5",Implies:"\u21d2",incare:"\u2105",in:"\u2208",infin:"\u221e",infintie:"\u29dd",inodot:"\u0131",intcal:"\u22ba",int:"\u222b",Int:"\u222c",integers:"\u2124",Integral:"\u222b",intercal:"\u22ba",Intersection:"\u22c2",intlarhk:"\u2a17",intprod:"\u2a3c",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012e",iogon:"\u012f",Iopf:"\ud835\udd40",iopf:"\ud835\udd5a",Iota:"\u0399",iota:"\u03b9",iprod:"\u2a3c",iquest:"\xbf",iscr:"\ud835\udcbe",Iscr:"\u2110",isin:"\u2208",isindot:"\u22f5",isinE:"\u22f9",isins:"\u22f4",isinsv:"\u22f3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xcf",iuml:"\xef",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\ud835\udd0d",jfr:"\ud835\udd27",jmath:"\u0237",Jopf:"\ud835\udd41",jopf:"\ud835\udd5b",Jscr:"\ud835\udca5",jscr:"\ud835\udcbf",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039a",kappa:"\u03ba",kappav:"\u03f0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041a",kcy:"\u043a",Kfr:"\ud835\udd0e",kfr:"\ud835\udd28",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040c",kjcy:"\u045c",Kopf:"\ud835\udd42",kopf:"\ud835\udd5c",Kscr:"\ud835\udca6",kscr:"\ud835\udcc0",lAarr:"\u21da",Lacute:"\u0139",lacute:"\u013a",laemptyv:"\u29b4",lagran:"\u2112",Lambda:"\u039b",lambda:"\u03bb",lang:"\u27e8",Lang:"\u27ea",langd:"\u2991",langle:"\u27e8",lap:"\u2a85",Laplacetrf:"\u2112",laquo:"\xab",larrb:"\u21e4",larrbfs:"\u291f",larr:"\u2190",Larr:"\u219e",lArr:"\u21d0",larrfs:"\u291d",larrhk:"\u21a9",larrlp:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",latail:"\u2919",lAtail:"\u291b",lat:"\u2aab",late:"\u2aad",lates:"\u2aad\ufe00",lbarr:"\u290c",lBarr:"\u290e",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",Lcaron:"\u013d",lcaron:"\u013e",Lcedil:"\u013b",lcedil:"\u013c",lceil:"\u2308",lcub:"{",Lcy:"\u041b",lcy:"\u043b",ldca:"\u2936",ldquo:"\u201c",ldquor:"\u201e",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",le:"\u2264",lE:"\u2266",LeftAngleBracket:"\u27e8",LeftArrowBar:"\u21e4",leftarrow:"\u2190",LeftArrow:"\u2190",Leftarrow:"\u21d0",LeftArrowRightArrow:"\u21c6",leftarrowtail:"\u21a2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVectorBar:"\u2959",LeftDownVector:"\u21c3",LeftFloor:"\u230a",leftharpoondown:"\u21bd",leftharpoonup:"\u21bc",leftleftarrows:"\u21c7",leftrightarrow:"\u2194",LeftRightArrow:"\u2194",Leftrightarrow:"\u21d4",leftrightarrows:"\u21c6",leftrightharpoons:"\u21cb",leftrightsquigarrow:"\u21ad",LeftRightVector:"\u294e",LeftTeeArrow:"\u21a4",LeftTee:"\u22a3",LeftTeeVector:"\u295a",leftthreetimes:"\u22cb",LeftTriangleBar:"\u29cf",LeftTriangle:"\u22b2",LeftTriangleEqual:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVectorBar:"\u2958",LeftUpVector:"\u21bf",LeftVectorBar:"\u2952",LeftVector:"\u21bc",lEg:"\u2a8b",leg:"\u22da",leq:"\u2264",leqq:"\u2266",leqslant:"\u2a7d",lescc:"\u2aa8",les:"\u2a7d",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessapprox:"\u2a85",lessdot:"\u22d6",lesseqgtr:"\u22da",lesseqqgtr:"\u2a8b",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2aa1",lesssim:"\u2272",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",lfisht:"\u297c",lfloor:"\u230a",Lfr:"\ud835\udd0f",lfr:"\ud835\udd29",lg:"\u2276",lgE:"\u2a91",lHar:"\u2962",lhard:"\u21bd",lharu:"\u21bc",lharul:"\u296a",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",llarr:"\u21c7",ll:"\u226a",Ll:"\u22d8",llcorner:"\u231e",Lleftarrow:"\u21da",llhard:"\u296b",lltri:"\u25fa",Lmidot:"\u013f",lmidot:"\u0140",lmoustache:"\u23b0",lmoust:"\u23b0",lnap:"\u2a89",lnapprox:"\u2a89",lne:"\u2a87",lnE:"\u2268",lneq:"\u2a87",lneqq:"\u2268",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",lobrk:"\u27e6",longleftarrow:"\u27f5",LongLeftArrow:"\u27f5",Longleftarrow:"\u27f8",longleftrightarrow:"\u27f7",LongLeftRightArrow:"\u27f7",Longleftrightarrow:"\u27fa",longmapsto:"\u27fc",longrightarrow:"\u27f6",LongRightArrow:"\u27f6",Longrightarrow:"\u27f9",looparrowleft:"\u21ab",looparrowright:"\u21ac",lopar:"\u2985",Lopf:"\ud835\udd43",lopf:"\ud835\udd5d",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25ca",lozenge:"\u25ca",lozf:"\u29eb",lpar:"(",lparlt:"\u2993",lrarr:"\u21c6",lrcorner:"\u231f",lrhar:"\u21cb",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",lscr:"\ud835\udcc1",Lscr:"\u2112",lsh:"\u21b0",Lsh:"\u21b0",lsim:"\u2272",lsime:"\u2a8d",lsimg:"\u2a8f",lsqb:"[",lsquo:"\u2018",lsquor:"\u201a",Lstrok:"\u0141",lstrok:"\u0142",ltcc:"\u2aa6",ltcir:"\u2a79",lt:"<",LT:"<",Lt:"\u226a",ltdot:"\u22d6",lthree:"\u22cb",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltri:"\u25c3",ltrie:"\u22b4",ltrif:"\u25c2",ltrPar:"\u2996",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe00",lvnE:"\u2268\ufe00",macr:"\xaf",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21a6",mapsto:"\u21a6",mapstodown:"\u21a7",mapstoleft:"\u21a4",mapstoup:"\u21a5",marker:"\u25ae",mcomma:"\u2a29",Mcy:"\u041c",mcy:"\u043c",mdash:"\u2014",mDDot:"\u223a",measuredangle:"\u2221",MediumSpace:"\u205f",Mellintrf:"\u2133",Mfr:"\ud835\udd10",mfr:"\ud835\udd2a",mho:"\u2127",micro:"\xb5",midast:"*",midcir:"\u2af0",mid:"\u2223",middot:"\xb7",minusb:"\u229f",minus:"\u2212",minusd:"\u2238",minusdu:"\u2a2a",MinusPlus:"\u2213",mlcp:"\u2adb",mldr:"\u2026",mnplus:"\u2213",models:"\u22a7",Mopf:"\ud835\udd44",mopf:"\ud835\udd5e",mp:"\u2213",mscr:"\ud835\udcc2",Mscr:"\u2133",mstpos:"\u223e",Mu:"\u039c",mu:"\u03bc",multimap:"\u22b8",mumap:"\u22b8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20d2",nap:"\u2249",napE:"\u2a70\u0338",napid:"\u224b\u0338",napos:"\u0149",napprox:"\u2249",natural:"\u266e",naturals:"\u2115",natur:"\u266e",nbsp:"\xa0",nbump:"\u224e\u0338",nbumpe:"\u224f\u0338",ncap:"\u2a43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2a6d\u0338",ncup:"\u2a42",Ncy:"\u041d",ncy:"\u043d",ndash:"\u2013",nearhk:"\u2924",nearr:"\u2197",neArr:"\u21d7",nearrow:"\u2197",ne:"\u2260",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200b",NegativeThickSpace:"\u200b",NegativeThinSpace:"\u200b",NegativeVeryThinSpace:"\u200b",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NewLine:"\n",nexist:"\u2204",nexists:"\u2204",Nfr:"\ud835\udd11",nfr:"\ud835\udd2b",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2a7e\u0338",nges:"\u2a7e\u0338",nGg:"\u22d9\u0338",ngsim:"\u2275",nGt:"\u226b\u20d2",ngt:"\u226f",ngtr:"\u226f",nGtv:"\u226b\u0338",nharr:"\u21ae",nhArr:"\u21ce",nhpar:"\u2af2",ni:"\u220b",nis:"\u22fc",nisd:"\u22fa",niv:"\u220b",NJcy:"\u040a",njcy:"\u045a",nlarr:"\u219a",nlArr:"\u21cd",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nleftarrow:"\u219a",nLeftarrow:"\u21cd",nleftrightarrow:"\u21ae",nLeftrightarrow:"\u21ce",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2a7d\u0338",nles:"\u2a7d\u0338",nless:"\u226e",nLl:"\u22d8\u0338",nlsim:"\u2274",nLt:"\u226a\u20d2",nlt:"\u226e",nltri:"\u22ea",nltrie:"\u22ec",nLtv:"\u226a\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xa0",nopf:"\ud835\udd5f",Nopf:"\u2115",Not:"\u2aec",not:"\xac",NotCongruent:"\u2262",NotCupCap:"\u226d",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226b\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2a7e\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224e\u0338",NotHumpEqual:"\u224f\u0338",notin:"\u2209",notindot:"\u22f5\u0338",notinE:"\u22f9\u0338",notinva:"\u2209",notinvb:"\u22f7",notinvc:"\u22f6",NotLeftTriangleBar:"\u29cf\u0338",NotLeftTriangle:"\u22ea",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226a\u0338",NotLessSlantEqual:"\u2a7d\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2aa2\u0338",NotNestedLessLess:"\u2aa1\u0338",notni:"\u220c",notniva:"\u220c",notnivb:"\u22fe",notnivc:"\u22fd",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2aaf\u0338",NotPrecedesSlantEqual:"\u22e0",NotReverseElement:"\u220c",NotRightTriangleBar:"\u29d0\u0338",NotRightTriangle:"\u22eb",NotRightTriangleEqual:"\u22ed",NotSquareSubset:"\u228f\u0338",NotSquareSubsetEqual:"\u22e2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22e3",NotSubset:"\u2282\u20d2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2ab0\u0338",NotSucceedsSlantEqual:"\u22e1",NotSucceedsTilde:"\u227f\u0338",NotSuperset:"\u2283\u20d2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",nparallel:"\u2226",npar:"\u2226",nparsl:"\u2afd\u20e5",npart:"\u2202\u0338",npolint:"\u2a14",npr:"\u2280",nprcue:"\u22e0",nprec:"\u2280",npreceq:"\u2aaf\u0338",npre:"\u2aaf\u0338",nrarrc:"\u2933\u0338",nrarr:"\u219b",nrArr:"\u21cf",nrarrw:"\u219d\u0338",nrightarrow:"\u219b",nRightarrow:"\u21cf",nrtri:"\u22eb",nrtrie:"\u22ed",nsc:"\u2281",nsccue:"\u22e1",nsce:"\u2ab0\u0338",Nscr:"\ud835\udca9",nscr:"\ud835\udcc3",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22e2",nsqsupe:"\u22e3",nsub:"\u2284",nsubE:"\u2ac5\u0338",nsube:"\u2288",nsubset:"\u2282\u20d2",nsubseteq:"\u2288",nsubseteqq:"\u2ac5\u0338",nsucc:"\u2281",nsucceq:"\u2ab0\u0338",nsup:"\u2285",nsupE:"\u2ac6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20d2",nsupseteq:"\u2289",nsupseteqq:"\u2ac6\u0338",ntgl:"\u2279",Ntilde:"\xd1",ntilde:"\xf1",ntlg:"\u2278",ntriangleleft:"\u22ea",ntrianglelefteq:"\u22ec",ntriangleright:"\u22eb",ntrianglerighteq:"\u22ed",Nu:"\u039d",nu:"\u03bd",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224d\u20d2",nvdash:"\u22ac",nvDash:"\u22ad",nVdash:"\u22ae",nVDash:"\u22af",nvge:"\u2265\u20d2",nvgt:">\u20d2",nvHarr:"\u2904",nvinfin:"\u29de",nvlArr:"\u2902",nvle:"\u2264\u20d2",nvlt:"<\u20d2",nvltrie:"\u22b4\u20d2",nvrArr:"\u2903",nvrtrie:"\u22b5\u20d2",nvsim:"\u223c\u20d2",nwarhk:"\u2923",nwarr:"\u2196",nwArr:"\u21d6",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xd3",oacute:"\xf3",oast:"\u229b",Ocirc:"\xd4",ocirc:"\xf4",ocir:"\u229a",Ocy:"\u041e",ocy:"\u043e",odash:"\u229d",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2a38",odot:"\u2299",odsold:"\u29bc",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29bf",Ofr:"\ud835\udd12",ofr:"\ud835\udd2c",ogon:"\u02db",Ograve:"\xd2",ograve:"\xf2",ogt:"\u29c1",ohbar:"\u29b5",ohm:"\u03a9",oint:"\u222e",olarr:"\u21ba",olcir:"\u29be",olcross:"\u29bb",oline:"\u203e",olt:"\u29c0",Omacr:"\u014c",omacr:"\u014d",Omega:"\u03a9",omega:"\u03c9",Omicron:"\u039f",omicron:"\u03bf",omid:"\u29b6",ominus:"\u2296",Oopf:"\ud835\udd46",oopf:"\ud835\udd60",opar:"\u29b7",OpenCurlyDoubleQuote:"\u201c",OpenCurlyQuote:"\u2018",operp:"\u29b9",oplus:"\u2295",orarr:"\u21bb",Or:"\u2a54",or:"\u2228",ord:"\u2a5d",order:"\u2134",orderof:"\u2134",ordf:"\xaa",ordm:"\xba",origof:"\u22b6",oror:"\u2a56",orslope:"\u2a57",orv:"\u2a5b",oS:"\u24c8",Oscr:"\ud835\udcaa",oscr:"\u2134",Oslash:"\xd8",oslash:"\xf8",osol:"\u2298",Otilde:"\xd5",otilde:"\xf5",otimesas:"\u2a36",Otimes:"\u2a37",otimes:"\u2297",Ouml:"\xd6",ouml:"\xf6",ovbar:"\u233d",OverBar:"\u203e",OverBrace:"\u23de",OverBracket:"\u23b4",OverParenthesis:"\u23dc",para:"\xb6",parallel:"\u2225",par:"\u2225",parsim:"\u2af3",parsl:"\u2afd",part:"\u2202",PartialD:"\u2202",Pcy:"\u041f",pcy:"\u043f",percnt:"%",period:".",permil:"\u2030",perp:"\u22a5",pertenk:"\u2031",Pfr:"\ud835\udd13",pfr:"\ud835\udd2d",Phi:"\u03a6",phi:"\u03c6",phiv:"\u03d5",phmmat:"\u2133",phone:"\u260e",Pi:"\u03a0",pi:"\u03c0",pitchfork:"\u22d4",piv:"\u03d6",planck:"\u210f",planckh:"\u210e",plankv:"\u210f",plusacir:"\u2a23",plusb:"\u229e",pluscir:"\u2a22",plus:"+",plusdo:"\u2214",plusdu:"\u2a25",pluse:"\u2a72",PlusMinus:"\xb1",plusmn:"\xb1",plussim:"\u2a26",plustwo:"\u2a27",pm:"\xb1",Poincareplane:"\u210c",pointint:"\u2a15",popf:"\ud835\udd61",Popf:"\u2119",pound:"\xa3",prap:"\u2ab7",Pr:"\u2abb",pr:"\u227a",prcue:"\u227c",precapprox:"\u2ab7",prec:"\u227a",preccurlyeq:"\u227c",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",preceq:"\u2aaf",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",pre:"\u2aaf",prE:"\u2ab3",precsim:"\u227e",prime:"\u2032",Prime:"\u2033",primes:"\u2119",prnap:"\u2ab9",prnE:"\u2ab5",prnsim:"\u22e8",prod:"\u220f",Product:"\u220f",profalar:"\u232e",profline:"\u2312",profsurf:"\u2313",prop:"\u221d",Proportional:"\u221d",Proportion:"\u2237",propto:"\u221d",prsim:"\u227e",prurel:"\u22b0",Pscr:"\ud835\udcab",pscr:"\ud835\udcc5",Psi:"\u03a8",psi:"\u03c8",puncsp:"\u2008",Qfr:"\ud835\udd14",qfr:"\ud835\udd2e",qint:"\u2a0c",qopf:"\ud835\udd62",Qopf:"\u211a",qprime:"\u2057",Qscr:"\ud835\udcac",qscr:"\ud835\udcc6",quaternions:"\u210d",quatint:"\u2a16",quest:"?",questeq:"\u225f",quot:'"',QUOT:'"',rAarr:"\u21db",race:"\u223d\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221a",raemptyv:"\u29b3",rang:"\u27e9",Rang:"\u27eb",rangd:"\u2992",range:"\u29a5",rangle:"\u27e9",raquo:"\xbb",rarrap:"\u2975",rarrb:"\u21e5",rarrbfs:"\u2920",rarrc:"\u2933",rarr:"\u2192",Rarr:"\u21a0",rArr:"\u21d2",rarrfs:"\u291e",rarrhk:"\u21aa",rarrlp:"\u21ac",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21a3",rarrw:"\u219d",ratail:"\u291a",rAtail:"\u291c",ratio:"\u2236",rationals:"\u211a",rbarr:"\u290d",rBarr:"\u290f",RBarr:"\u2910",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298c",rbrksld:"\u298e",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201d",rdquor:"\u201d",rdsh:"\u21b3",real:"\u211c",realine:"\u211b",realpart:"\u211c",reals:"\u211d",Re:"\u211c",rect:"\u25ad",reg:"\xae",REG:"\xae",ReverseElement:"\u220b",ReverseEquilibrium:"\u21cb",ReverseUpEquilibrium:"\u296f",rfisht:"\u297d",rfloor:"\u230b",rfr:"\ud835\udd2f",Rfr:"\u211c",rHar:"\u2964",rhard:"\u21c1",rharu:"\u21c0",rharul:"\u296c",Rho:"\u03a1",rho:"\u03c1",rhov:"\u03f1",RightAngleBracket:"\u27e9",RightArrowBar:"\u21e5",rightarrow:"\u2192",RightArrow:"\u2192",Rightarrow:"\u21d2",RightArrowLeftArrow:"\u21c4",rightarrowtail:"\u21a3",RightCeiling:"\u2309",RightDoubleBracket:"\u27e7",RightDownTeeVector:"\u295d",RightDownVectorBar:"\u2955",RightDownVector:"\u21c2",RightFloor:"\u230b",rightharpoondown:"\u21c1",rightharpoonup:"\u21c0",rightleftarrows:"\u21c4",rightleftharpoons:"\u21cc",rightrightarrows:"\u21c9",rightsquigarrow:"\u219d",RightTeeArrow:"\u21a6",RightTee:"\u22a2",RightTeeVector:"\u295b",rightthreetimes:"\u22cc",RightTriangleBar:"\u29d0",RightTriangle:"\u22b3",RightTriangleEqual:"\u22b5",RightUpDownVector:"\u294f",RightUpTeeVector:"\u295c",RightUpVectorBar:"\u2954",RightUpVector:"\u21be",RightVectorBar:"\u2953",RightVector:"\u21c0",ring:"\u02da",risingdotseq:"\u2253",rlarr:"\u21c4",rlhar:"\u21cc",rlm:"\u200f",rmoustache:"\u23b1",rmoust:"\u23b1",rnmid:"\u2aee",roang:"\u27ed",roarr:"\u21fe",robrk:"\u27e7",ropar:"\u2986",ropf:"\ud835\udd63",Ropf:"\u211d",roplus:"\u2a2e",rotimes:"\u2a35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2a12",rrarr:"\u21c9",Rrightarrow:"\u21db",rsaquo:"\u203a",rscr:"\ud835\udcc7",Rscr:"\u211b",rsh:"\u21b1",Rsh:"\u21b1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22cc",rtimes:"\u22ca",rtri:"\u25b9",rtrie:"\u22b5",rtrif:"\u25b8",rtriltri:"\u29ce",RuleDelayed:"\u29f4",ruluhar:"\u2968",rx:"\u211e",Sacute:"\u015a",sacute:"\u015b",sbquo:"\u201a",scap:"\u2ab8",Scaron:"\u0160",scaron:"\u0161",Sc:"\u2abc",sc:"\u227b",sccue:"\u227d",sce:"\u2ab0",scE:"\u2ab4",Scedil:"\u015e",scedil:"\u015f",Scirc:"\u015c",scirc:"\u015d",scnap:"\u2aba",scnE:"\u2ab6",scnsim:"\u22e9",scpolint:"\u2a13",scsim:"\u227f",Scy:"\u0421",scy:"\u0441",sdotb:"\u22a1",sdot:"\u22c5",sdote:"\u2a66",searhk:"\u2925",searr:"\u2198",seArr:"\u21d8",searrow:"\u2198",sect:"\xa7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\ud835\udd16",sfr:"\ud835\udd30",sfrown:"\u2322",sharp:"\u266f",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xad",Sigma:"\u03a3",sigma:"\u03c3",sigmaf:"\u03c2",sigmav:"\u03c2",sim:"\u223c",simdot:"\u2a6a",sime:"\u2243",simeq:"\u2243",simg:"\u2a9e",simgE:"\u2aa0",siml:"\u2a9d",simlE:"\u2a9f",simne:"\u2246",simplus:"\u2a24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2a33",smeparsl:"\u29e4",smid:"\u2223",smile:"\u2323",smt:"\u2aaa",smte:"\u2aac",smtes:"\u2aac\ufe00",SOFTcy:"\u042c",softcy:"\u044c",solbar:"\u233f",solb:"\u29c4",sol:"/",Sopf:"\ud835\udd4a",sopf:"\ud835\udd64",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\ufe00",sqcup:"\u2294",sqcups:"\u2294\ufe00",Sqrt:"\u221a",sqsub:"\u228f",sqsube:"\u2291",sqsubset:"\u228f",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",square:"\u25a1",Square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25aa",squ:"\u25a1",squf:"\u25aa",srarr:"\u2192",Sscr:"\ud835\udcae",sscr:"\ud835\udcc8",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22c6",Star:"\u22c6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03f5",straightphi:"\u03d5",strns:"\xaf",sub:"\u2282",Sub:"\u22d0",subdot:"\u2abd",subE:"\u2ac5",sube:"\u2286",subedot:"\u2ac3",submult:"\u2ac1",subnE:"\u2acb",subne:"\u228a",subplus:"\u2abf",subrarr:"\u2979",subset:"\u2282",Subset:"\u22d0",subseteq:"\u2286",subseteqq:"\u2ac5",SubsetEqual:"\u2286",subsetneq:"\u228a",subsetneqq:"\u2acb",subsim:"\u2ac7",subsub:"\u2ad5",subsup:"\u2ad3",succapprox:"\u2ab8",succ:"\u227b",succcurlyeq:"\u227d",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",succeq:"\u2ab0",succnapprox:"\u2aba",succneqq:"\u2ab6",succnsim:"\u22e9",succsim:"\u227f",SuchThat:"\u220b",sum:"\u2211",Sum:"\u2211",sung:"\u266a",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",sup:"\u2283",Sup:"\u22d1",supdot:"\u2abe",supdsub:"\u2ad8",supE:"\u2ac6",supe:"\u2287",supedot:"\u2ac4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27c9",suphsub:"\u2ad7",suplarr:"\u297b",supmult:"\u2ac2",supnE:"\u2acc",supne:"\u228b",supplus:"\u2ac0",supset:"\u2283",Supset:"\u22d1",supseteq:"\u2287",supseteqq:"\u2ac6",supsetneq:"\u228b",supsetneqq:"\u2acc",supsim:"\u2ac8",supsub:"\u2ad4",supsup:"\u2ad6",swarhk:"\u2926",swarr:"\u2199",swArr:"\u21d9",swarrow:"\u2199",swnwar:"\u292a",szlig:"\xdf",Tab:"\t",target:"\u2316",Tau:"\u03a4",tau:"\u03c4",tbrk:"\u23b4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20db",telrec:"\u2315",Tfr:"\ud835\udd17",tfr:"\ud835\udd31",there4:"\u2234",therefore:"\u2234",Therefore:"\u2234",Theta:"\u0398",theta:"\u03b8",thetasym:"\u03d1",thetav:"\u03d1",thickapprox:"\u2248",thicksim:"\u223c",ThickSpace:"\u205f\u200a",ThinSpace:"\u2009",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223c",THORN:"\xde",thorn:"\xfe",tilde:"\u02dc",Tilde:"\u223c",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",timesbar:"\u2a31",timesb:"\u22a0",times:"\xd7",timesd:"\u2a30",tint:"\u222d",toea:"\u2928",topbot:"\u2336",topcir:"\u2af1",top:"\u22a4",Topf:"\ud835\udd4b",topf:"\ud835\udd65",topfork:"\u2ada",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",TRADE:"\u2122",triangle:"\u25b5",triangledown:"\u25bf",triangleleft:"\u25c3",trianglelefteq:"\u22b4",triangleq:"\u225c",triangleright:"\u25b9",trianglerighteq:"\u22b5",tridot:"\u25ec",trie:"\u225c",triminus:"\u2a3a",TripleDot:"\u20db",triplus:"\u2a39",trisb:"\u29cd",tritime:"\u2a3b",trpezium:"\u23e2",Tscr:"\ud835\udcaf",tscr:"\ud835\udcc9",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040b",tshcy:"\u045b",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226c",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",Uacute:"\xda",uacute:"\xfa",uarr:"\u2191",Uarr:"\u219f",uArr:"\u21d1",Uarrocir:"\u2949",Ubrcy:"\u040e",ubrcy:"\u045e",Ubreve:"\u016c",ubreve:"\u016d",Ucirc:"\xdb",ucirc:"\xfb",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21c5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296e",ufisht:"\u297e",Ufr:"\ud835\udd18",ufr:"\ud835\udd32",Ugrave:"\xd9",ugrave:"\xf9",uHar:"\u2963",uharl:"\u21bf",uharr:"\u21be",uhblk:"\u2580",ulcorn:"\u231c",ulcorner:"\u231c",ulcrop:"\u230f",ultri:"\u25f8",Umacr:"\u016a",umacr:"\u016b",uml:"\xa8",UnderBar:"_",UnderBrace:"\u23df",UnderBracket:"\u23b5",UnderParenthesis:"\u23dd",Union:"\u22c3",UnionPlus:"\u228e",Uogon:"\u0172",uogon:"\u0173",Uopf:"\ud835\udd4c",uopf:"\ud835\udd66",UpArrowBar:"\u2912",uparrow:"\u2191",UpArrow:"\u2191",Uparrow:"\u21d1",UpArrowDownArrow:"\u21c5",updownarrow:"\u2195",UpDownArrow:"\u2195",Updownarrow:"\u21d5",UpEquilibrium:"\u296e",upharpoonleft:"\u21bf",upharpoonright:"\u21be",uplus:"\u228e",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",upsi:"\u03c5",Upsi:"\u03d2",upsih:"\u03d2",Upsilon:"\u03a5",upsilon:"\u03c5",UpTeeArrow:"\u21a5",UpTee:"\u22a5",upuparrows:"\u21c8",urcorn:"\u231d",urcorner:"\u231d",urcrop:"\u230e",Uring:"\u016e",uring:"\u016f",urtri:"\u25f9",Uscr:"\ud835\udcb0",uscr:"\ud835\udcca",utdot:"\u22f0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25b5",utrif:"\u25b4",uuarr:"\u21c8",Uuml:"\xdc",uuml:"\xfc",uwangle:"\u29a7",vangrt:"\u299c",varepsilon:"\u03f5",varkappa:"\u03f0",varnothing:"\u2205",varphi:"\u03d5",varpi:"\u03d6",varpropto:"\u221d",varr:"\u2195",vArr:"\u21d5",varrho:"\u03f1",varsigma:"\u03c2",varsubsetneq:"\u228a\ufe00",varsubsetneqq:"\u2acb\ufe00",varsupsetneq:"\u228b\ufe00",varsupsetneqq:"\u2acc\ufe00",vartheta:"\u03d1",vartriangleleft:"\u22b2",vartriangleright:"\u22b3",vBar:"\u2ae8",Vbar:"\u2aeb",vBarv:"\u2ae9",Vcy:"\u0412",vcy:"\u0432",vdash:"\u22a2",vDash:"\u22a8",Vdash:"\u22a9",VDash:"\u22ab",Vdashl:"\u2ae6",veebar:"\u22bb",vee:"\u2228",Vee:"\u22c1",veeeq:"\u225a",vellip:"\u22ee",verbar:"|",Verbar:"\u2016",vert:"|",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200a",Vfr:"\ud835\udd19",vfr:"\ud835\udd33",vltri:"\u22b2",vnsub:"\u2282\u20d2",vnsup:"\u2283\u20d2",Vopf:"\ud835\udd4d",vopf:"\ud835\udd67",vprop:"\u221d",vrtri:"\u22b3",Vscr:"\ud835\udcb1",vscr:"\ud835\udccb",vsubnE:"\u2acb\ufe00",vsubne:"\u228a\ufe00",vsupnE:"\u2acc\ufe00",vsupne:"\u228b\ufe00",Vvdash:"\u22aa",vzigzag:"\u299a",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2a5f",wedge:"\u2227",Wedge:"\u22c0",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\ud835\udd1a",wfr:"\ud835\udd34",Wopf:"\ud835\udd4e",wopf:"\ud835\udd68",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\ud835\udcb2",wscr:"\ud835\udccc",xcap:"\u22c2",xcirc:"\u25ef",xcup:"\u22c3",xdtri:"\u25bd",Xfr:"\ud835\udd1b",xfr:"\ud835\udd35",xharr:"\u27f7",xhArr:"\u27fa",Xi:"\u039e",xi:"\u03be",xlarr:"\u27f5",xlArr:"\u27f8",xmap:"\u27fc",xnis:"\u22fb",xodot:"\u2a00",Xopf:"\ud835\udd4f",xopf:"\ud835\udd69",xoplus:"\u2a01",xotime:"\u2a02",xrarr:"\u27f6",xrArr:"\u27f9",Xscr:"\ud835\udcb3",xscr:"\ud835\udccd",xsqcup:"\u2a06",xuplus:"\u2a04",xutri:"\u25b3",xvee:"\u22c1",xwedge:"\u22c0",Yacute:"\xdd",yacute:"\xfd",YAcy:"\u042f",yacy:"\u044f",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042b",ycy:"\u044b",yen:"\xa5",Yfr:"\ud835\udd1c",yfr:"\ud835\udd36",YIcy:"\u0407",yicy:"\u0457",Yopf:"\ud835\udd50",yopf:"\ud835\udd6a",Yscr:"\ud835\udcb4",yscr:"\ud835\udcce",YUcy:"\u042e",yucy:"\u044e",yuml:"\xff",Yuml:"\u0178",Zacute:"\u0179",zacute:"\u017a",Zcaron:"\u017d",zcaron:"\u017e",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017b",zdot:"\u017c",zeetrf:"\u2128",ZeroWidthSpace:"\u200b",Zeta:"\u0396",zeta:"\u03b6",zfr:"\ud835\udd37",Zfr:"\u2128",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21dd",zopf:"\ud835\udd6b",Zopf:"\u2124",Zscr:"\ud835\udcb5",zscr:"\ud835\udccf",zwj:"\u200d",zwnj:"\u200c"},Ov=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Mv={},Pv={};function Dv(e){var t,n,r=Pv[e];if(r)return r;for(r=Pv[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),/^[0-9a-z]$/i.test(n)?r.push(n):r.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2));for(t=0;t=55296&&o<=57343){if(o>=55296&&o<=56319&&r+1=56320&&a<=57343){s+=encodeURIComponent(e[r]+e[r+1]),r++;continue}s+="%EF%BF%BD"}else s+=encodeURIComponent(e[r]);return s}ie(Dv,"getEncodeCache"),ie(Av,"encode$1"),Av.defaultChars=";/?:@&=+$,-_.!~*'()#",Av.componentChars="-_.!~*'()";var Zv=Av,jv={};function Lv(e){var t,n,r=jv[e];if(r)return r;for(r=jv[e]=[],t=0;t<128;t++)n=String.fromCharCode(t),r.push(n);for(t=0;t=55296&&s<=57343?"\ufffd\ufffd\ufffd":String.fromCharCode(s),t+=6):240===(248&i)&&t+91114111?u+="\ufffd\ufffd\ufffd\ufffd":(s-=65536,u+=String.fromCharCode(55296+(s>>10),56320+(1023&s))),t+=9):u+="\ufffd";return u}))}ie(Lv,"getDecodeCache"),ie(Fv,"decode$1"),Fv.defaultChars=";/?:@&=+$,#",Fv.componentChars="";var zv=Fv,Bv=ie((function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||""}),"format");function Vv(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}ie(Vv,"Url");var Hv=/^([a-z0-9.+-]+:)/i,Uv=/:[0-9]*$/,qv=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Wv=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),Gv=["'"].concat(Wv),Kv=["%","/","?",";","#"].concat(Gv),$v=["/","?","#"],Qv=/^[+a-z0-9A-Z_-]{0,63}$/,Yv=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Jv={javascript:!0,"javascript:":!0},Xv={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function em(e,t){if(e&&e instanceof Vv)return e;var n=new Vv;return n.parse(e,t),n}ie(em,"urlParse"),Vv.prototype.parse=function(e,t){var n,r,i,o,a,l=e;if(l=l.trim(),!t&&1===e.split("#").length){var s=qv.exec(l);if(s)return this.pathname=s[1],s[2]&&(this.search=s[2]),this}var u=Hv.exec(l);if(u&&(i=(u=u[0]).toLowerCase(),this.protocol=u,l=l.substr(u.length)),(t||u||l.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(a="//"===l.substr(0,2))||u&&Jv[u]||(l=l.substr(2),this.slashes=!0)),!Jv[u]&&(a||u&&!Xv[u])){var c,d,f=-1;for(n=0;n<$v.length;n++)-1!==(o=l.indexOf($v[n]))&&(-1===f||o127?g+="x":g+=m[b];if(!g.match(Qv)){var x=v.slice(0,n),w=v.slice(n+1),C=m.match(Yv);C&&(x.push(C[1]),w.unshift(C[2])),w.length&&(l=w.join(".")+l),this.hostname=x.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var k=l.indexOf("#");-1!==k&&(this.hash=l.substr(k),l=l.slice(0,k));var E=l.indexOf("?");return-1!==E&&(this.search=l.substr(E),l=l.slice(0,E)),l&&(this.pathname=l),Xv[i]&&this.hostname&&!this.pathname&&(this.pathname=""),this},Vv.prototype.parseHost=function(e){var t=Uv.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var tm=em;Mv.encode=Zv,Mv.decode=zv,Mv.format=Bv,Mv.parse=tm;var nm={},rm=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,im=/[\0-\x1F\x7F-\x9F]/,om=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;nm.Any=rm,nm.Cc=im,nm.Cf=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,nm.P=Ov,nm.Z=om,function(e){function t(e){return Object.prototype.toString.call(e)}function n(e){return"[object String]"===t(e)}ie(t,"_class"),ie(n,"isString");var r=Object.prototype.hasOwnProperty;function i(e,t){return r.call(e,t)}function o(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach((function(t){if(t){if("object"!==typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach((function(n){e[n]=t[n]}))}})),e}function a(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function l(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!==(65535&e)&&65534!==(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function s(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}ie(i,"has"),ie(o,"assign"),ie(a,"arrayReplaceAt"),ie(l,"isValidEntityCode"),ie(s,"fromCodePoint");var u=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,c=new RegExp(u.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),d=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,f=Nv;function p(e,t){var n=0;return i(f,t)?f[t]:35===t.charCodeAt(0)&&d.test(t)&&l(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?s(n):e}function h(e){return e.indexOf("\\")<0?e:e.replace(u,"$1")}function v(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(c,(function(e,t,n){return t||p(e,n)}))}ie(p,"replaceEntityPattern"),ie(h,"unescapeMd"),ie(v,"unescapeAll");var m=/[&<>"]/,g=/[&<>"]/g,b={"&":"&","<":"<",">":">",'"':"""};function y(e){return b[e]}function x(e){return m.test(e)?e.replace(g,y):e}ie(y,"replaceUnsafeChar"),ie(x,"escapeHtml");var w=/[.?*+^$[\]\\(){}|-]/g;function C(e){return e.replace(w,"\\$&")}function k(e){switch(e){case 9:case 32:return!0}return!1}function E(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}ie(C,"escapeRE"),ie(k,"isSpace"),ie(E,"isWhiteSpace");var S=Ov;function T(e){return S.test(e)}function _(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function I(e){return e=e.trim().replace(/\s+/g," "),"\u1e7e"==="\u1e9e".toLowerCase()&&(e=e.replace(/\u1e9e/g,"\xdf")),e.toLowerCase().toUpperCase()}ie(T,"isPunctChar"),ie(_,"isMdAsciiPunct"),ie(I,"normalizeReference"),e.lib={},e.lib.mdurl=Mv,e.lib.ucmicro=nm,e.assign=o,e.isString=n,e.has=i,e.unescapeMd=h,e.unescapeAll=v,e.isValidEntityCode=l,e.fromCodePoint=s,e.escapeHtml=x,e.arrayReplaceAt=a,e.isSpace=k,e.isWhiteSpace=E,e.isMdAsciiPunct=_,e.isPunctChar=T,e.escapeRE=C,e.normalizeReference=I}(Rv);var am={},lm=ie((function(e,t,n){var r,i,o,a,l=-1,s=e.posMax,u=e.pos;for(e.pos=t+1,r=1;e.pos32)return a;if(41===r){if(0===i)break;i--}t++}return o===t||0!==i||(a.str=sm(e.slice(o,t)),a.lines=0,a.pos=t,a.ok=!0),a}),"parseLinkDestination"),cm=Rv.unescapeAll,dm=ie((function(e,t,n){var r,i,o=0,a=t,l={ok:!1,pos:0,lines:0,str:""};if(t>=n)return l;if(34!==(i=e.charCodeAt(t))&&39!==i&&40!==i)return l;for(t++,40===i&&(i=41);t"+hm(e[t].content)+""},vm.code_block=function(e,t,n,r,i){var o=e[t];return""+hm(e[t].content)+"\n"},vm.fence=function(e,t,n,r,i){var o,a,l,s,u,c=e[t],d=c.info?pm(c.info).trim():"",f="",p="";return d&&(f=(l=d.split(/(\s+)/g))[0],p=l.slice(2).join("")),0===(o=n.highlight&&n.highlight(c.content,f,p)||hm(c.content)).indexOf(""+o+"\n"):"
"+o+"
\n"},vm.image=function(e,t,n,r,i){var o=e[t];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(e,t,n)},vm.hardbreak=function(e,t,n){return n.xhtmlOut?"
\n":"
\n"},vm.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"
\n":"
\n":"\n"},vm.text=function(e,t){return hm(e[t].content)},vm.html_block=function(e,t){return e[t].content},vm.html_inline=function(e,t){return e[t].content},ie(mm,"Renderer$1"),mm.prototype.renderAttrs=ie((function(e){var t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t\n":">")}),"renderToken"),mm.prototype.renderInline=function(e,t,n){for(var r,i="",o=this.rules,a=0,l=e.length;a\s]/i.test(e)}function _m(e){return/^<\/a\s*>/i.test(e)}ie(Tm,"isLinkOpen"),ie(_m,"isLinkClose");var Im=ie((function(e){var t,n,r,i,o,a,l,s,u,c,d,f,p,h,v,m,g,b=e.tokens;if(e.md.options.linkify)for(n=0,r=b.length;n=0;t--)if("link_close"!==(a=i[t]).type){if("html_inline"===a.type&&(Tm(a.content)&&p>0&&p--,_m(a.content)&&p++),!(p>0)&&"text"===a.type&&e.md.linkify.test(a.content)){for(u=a.content,g=e.md.linkify.match(u),l=[],f=a.level,d=0,s=0;sd&&((o=new e.Token("text","",0)).content=u.slice(d,c),o.level=f,l.push(o)),(o=new e.Token("link_open","a",1)).attrs=[["href",v]],o.level=f++,o.markup="linkify",o.info="auto",l.push(o),(o=new e.Token("text","",0)).content=m,o.level=f,l.push(o),(o=new e.Token("link_close","a",-1)).level=--f,o.markup="linkify",o.info="auto",l.push(o),d=g[s].lastIndex);d=0;t--)"text"!==(n=e[t]).type||r||(n.content=n.content.replace(Om,Pm)),"link_open"===n.type&&"auto"===n.info&&r--,"link_close"===n.type&&"auto"===n.info&&r++}function Am(e){var t,n,r=0;for(t=e.length-1;t>=0;t--)"text"!==(n=e[t]).type||r||Rm.test(n.content)&&(n.content=n.content.replace(/\+-/g,"\xb1").replace(/\.{2,}/g,"\u2026").replace(/([?!])\u2026/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1\u2014").replace(/(^|\s)--(?=\s|$)/gm,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1\u2013")),"link_open"===n.type&&"auto"===n.info&&r--,"link_close"===n.type&&"auto"===n.info&&r++}ie(Pm,"replaceFn"),ie(Dm,"replace_scoped"),ie(Am,"replace_rare");var Zm=ie((function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&(Nm.test(e.tokens[t].content)&&Dm(e.tokens[t].children),Rm.test(e.tokens[t].content)&&Am(e.tokens[t].children))}),"replace"),jm=Rv.isWhiteSpace,Lm=Rv.isPunctChar,Fm=Rv.isMdAsciiPunct,zm=/['"]/,Bm=/['"]/g;function Vm(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}function Hm(e,t){var n,r,i,o,a,l,s,u,c,d,f,p,h,v,m,g,b,y,x,w,C;for(x=[],n=0;n=0&&!(x[b].level<=s);b--);if(x.length=b+1,"text"===r.type){a=0,l=(i=r.content).length;e:for(;a=0)c=i.charCodeAt(o.index-1);else for(b=n-1;b>=0&&("softbreak"!==e[b].type&&"hardbreak"!==e[b].type);b--)if(e[b].content){c=e[b].content.charCodeAt(e[b].content.length-1);break}if(d=32,a=48&&c<=57&&(g=m=!1),m&&g&&(m=f,g=p),m||g){if(g)for(b=x.length-1;b>=0&&(u=x[b],!(x[b].level=0;t--)"inline"===e.tokens[t].type&&zm.test(e.tokens[t].content)&&Hm(e.tokens[t].children,e)}),"smartquotes");function qm(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}ie(qm,"Token$3"),qm.prototype.attrIndex=ie((function(e){var t,n,r;if(!this.attrs)return-1;for(n=0,r=(t=this.attrs).length;n=0&&(n=this.attrs[t][1]),n}),"attrGet"),qm.prototype.attrJoin=ie((function(e,t){var n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t}),"attrJoin");var Wm=qm,Gm=Wm;function Km(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}ie(Km,"StateCore"),Km.prototype.Token=Gm;var $m=Km,Qm=ym,Ym=[["normalize",Cm],["block",km],["inline",Em],["linkify",Im],["replacements",Zm],["smartquotes",Um]];function Jm(){this.ruler=new Qm;for(var e=0;en)return!1;if(u=t+1,e.sCount[u]=4)return!1;if((a=e.bMarks[u]+e.tShift[u])>=e.eMarks[u])return!1;if(124!==(x=e.src.charCodeAt(a++))&&45!==x&&58!==x)return!1;if(a>=e.eMarks[u])return!1;if(124!==(w=e.src.charCodeAt(a++))&&45!==w&&58!==w&&!eg(w))return!1;if(45===x&&eg(w))return!1;for(;a=4)return!1;if((c=ng(o)).length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop(),0===(d=c.length)||d!==p.length)return!1;if(r)return!0;for(g=e.parentType,e.parentType="table",y=e.md.block.ruler.getRules("blockquote"),(f=e.push("table_open","table",1)).map=v=[t,0],(f=e.push("thead_open","thead",1)).map=[t,t+1],(f=e.push("tr_open","tr",1)).map=[t,t+1],l=0;l=4)break;for((c=ng(o)).length&&""===c[0]&&c.shift(),c.length&&""===c[c.length-1]&&c.pop(),u===t+2&&((f=e.push("tbody_open","tbody",1)).map=m=[t+2,0]),(f=e.push("tr_open","tr",1)).map=[u,u+1],l=0;l=4))break;i=++r}return e.line=i,(o=e.push("code_block","code",0)).content=e.getLines(t,i,4+e.blkIndent,!1)+"\n",o.map=[t,e.line],!0}),"code"),og=ie((function(e,t,n,r){var i,o,a,l,s,u,c,d=!1,f=e.bMarks[t]+e.tShift[t],p=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(f+3>p)return!1;if(126!==(i=e.src.charCodeAt(f))&&96!==i)return!1;if(s=f,(o=(f=e.skipChars(f,i))-s)<3)return!1;if(c=e.src.slice(s,f),a=e.src.slice(f,p),96===i&&a.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;for(l=t;!(++l>=n)&&!((f=s=e.bMarks[l]+e.tShift[l])<(p=e.eMarks[l])&&e.sCount[l]=4)&&!((f=e.skipChars(f,i))-s=4)return!1;if(62!==e.src.charCodeAt(S++))return!1;if(r)return!0;for(l=f=e.sCount[t]+1,32===e.src.charCodeAt(S)?(S++,l++,f++,i=!1,y=!0):9===e.src.charCodeAt(S)?(y=!0,(e.bsCount[t]+f)%4===3?(S++,l++,f++,i=!1):i=!0):y=!1,p=[e.bMarks[t]],e.bMarks[t]=S;S=T,g=[e.sCount[t]],e.sCount[t]=f-l,b=[e.tShift[t]],e.tShift[t]=S-e.bMarks[t],w=e.md.block.ruler.getRules("blockquote"),m=e.parentType,e.parentType="blockquote",d=t+1;d=(T=e.eMarks[d])));d++)if(62!==e.src.charCodeAt(S++)||k){if(u)break;for(x=!1,a=0,s=w.length;a=T,h.push(e.bsCount[d]),e.bsCount[d]=e.sCount[d]+1+(y?1:0),g.push(e.sCount[d]),e.sCount[d]=f-l,b.push(e.tShift[d]),e.tShift[d]=S-e.bMarks[d]}for(v=e.blkIndent,e.blkIndent=0,(C=e.push("blockquote_open","blockquote",1)).markup=">",C.map=c=[t,0],e.md.block.tokenize(e,t,d),(C=e.push("blockquote_close","blockquote",-1)).markup=">",e.lineMax=E,e.parentType=m,c[1]=e.line,a=0;a=4)return!1;if(42!==(i=e.src.charCodeAt(s++))&&45!==i&&95!==i)return!1;for(o=1;s=o)return-1;if((n=e.src.charCodeAt(i++))<48||n>57)return-1;for(;;){if(i>=o)return-1;if(!((n=e.src.charCodeAt(i++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(i-r>=10)return-1}return i=4)return!1;if(e.listIndent>=0&&e.sCount[t]-e.listIndent>=4&&e.sCount[t]=e.blkIndent&&(M=!0),(T=fg(e,t))>=0){if(c=!0,I=e.bMarks[t]+e.tShift[t],m=Number(e.src.slice(I,T-1)),M&&1!==m)return!1}else{if(!((T=dg(e,t))>=0))return!1;c=!1}if(M&&e.skipSpaces(T)>=e.eMarks[t])return!1;if(v=e.src.charCodeAt(T-1),r)return!0;for(h=e.tokens.length,c?(O=e.push("ordered_list_open","ol",1),1!==m&&(O.attrs=[["start",m]])):O=e.push("bullet_list_open","ul",1),O.map=p=[t,0],O.markup=String.fromCharCode(v),b=t,_=!1,N=e.md.block.ruler.getRules("list"),w=e.parentType,e.parentType="list";b=g?1:y-u)>4&&(s=1),l=u+s,(O=e.push("list_item_open","li",1)).markup=String.fromCharCode(v),O.map=d=[t,0],c&&(O.info=e.src.slice(I,T-1)),E=e.tight,k=e.tShift[t],C=e.sCount[t],x=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=l,e.tight=!0,e.tShift[t]=o-e.bMarks[t],e.sCount[t]=y,o>=g&&e.isEmpty(t+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,t,n,!0),e.tight&&!_||(P=!1),_=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=x,e.tShift[t]=k,e.sCount[t]=C,e.tight=E,(O=e.push("list_item_close","li",-1)).markup=String.fromCharCode(v),b=t=e.line,d[1]=b,o=e.bMarks[t],b>=n)break;if(e.sCount[b]=4)break;for(R=!1,a=0,f=N.length;a=4)return!1;if(91!==e.src.charCodeAt(w))return!1;for(;++w3)&&!(e.sCount[k]<0)){for(g=!1,u=0,c=b.length;u`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",xg="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",wg=new RegExp("^(?:"+yg+"|"+xg+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?][\\s\\S]*?[?]>|]*>|)"),Cg=new RegExp("^(?:"+yg+"|"+xg+")");bg.HTML_TAG_RE=wg,bg.HTML_OPEN_CLOSE_TAG_RE=Cg;var kg=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Eg=bg.HTML_OPEN_CLOSE_TAG_RE,Sg=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(Eg.source+"\\s*$"),/^$/,!1]],Tg=ie((function(e,t,n,r){var i,o,a,l,s=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(s))return!1;for(l=e.src.slice(s,u),i=0;i=4)return!1;if(35!==(i=e.src.charCodeAt(s))||s>=u)return!1;for(o=1,i=e.src.charCodeAt(++s);35===i&&s6||ss&&_g(e.src.charCodeAt(a-1))&&(u=a),e.line=t+1,(l=e.push("heading_open","h"+String(o),1)).markup="########".slice(0,o),l.map=[t,e.line],(l=e.push("inline","",0)).content=e.src.slice(s,u).trim(),l.map=[t,e.line],l.children=[],(l=e.push("heading_close","h"+String(o),-1)).markup="########".slice(0,o)),!0)}),"heading"),Rg=ie((function(e,t,n){var r,i,o,a,l,s,u,c,d,f,p=t+1,h=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;for(f=e.parentType,e.parentType="paragraph";p3)){if(e.sCount[p]>=e.blkIndent&&(s=e.bMarks[p]+e.tShift[p])<(u=e.eMarks[p])&&(45===(d=e.src.charCodeAt(s))||61===d)&&(s=e.skipChars(s,d),(s=e.skipSpaces(s))>=u)){c=61===d?1:2;break}if(!(e.sCount[p]<0)){for(i=!1,o=0,a=h.length;o3)&&!(e.sCount[s]<0)){for(r=!1,i=0,o=u.length;i0&&this.level++,this.tokens.push(r),r},Pg.prototype.isEmpty=ie((function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}),"isEmpty"),Pg.prototype.skipEmptyLines=ie((function(e){for(var t=this.lineMax;et;)if(!Mg(this.src.charCodeAt(--e)))return e+1;return e}),"skipSpacesBack"),Pg.prototype.skipChars=ie((function(e,t){for(var n=this.src.length;en;)if(t!==this.src.charCodeAt(--e))return e+1;return e}),"skipCharsBack"),Pg.prototype.getLines=ie((function(e,t,n,r){var i,o,a,l,s,u,c,d=e;if(e>=t)return"";for(u=new Array(t-e),i=0;dn?new Array(o-n+1).join(" ")+this.src.slice(l,s):this.src.slice(l,s)}return u.join("")}),"getLines"),Pg.prototype.Token=Og;var Dg=Pg,Ag=ym,Zg=[["table",rg,["paragraph","reference"]],["code",ig],["fence",og,["paragraph","reference","blockquote","list"]],["blockquote",lg,["paragraph","reference","blockquote","list"]],["hr",ug,["paragraph","reference","blockquote","list"]],["list",hg,["paragraph","reference","blockquote"]],["reference",gg],["html_block",Tg,["paragraph","reference","blockquote"]],["heading",Ig,["paragraph","reference","blockquote"]],["lheading",Rg],["paragraph",Ng]];function jg(){this.ruler=new Ag;for(var e=0;e=n))&&!(e.sCount[a]=s){e.line=n;break}for(r=0;r=0&&32===e.pending.charCodeAt(n)?n>=1&&32===e.pending.charCodeAt(n-1)?(e.pending=e.pending.replace(/ +$/,""),e.push("hardbreak","br",0)):(e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0)):e.push("softbreak","br",0)),i++;i?@[]^_`{|}~-".split("").forEach((function(e){Ug[e.charCodeAt(0)]=1}));var Wg=ie((function(e,t){var n,r=e.pos,i=e.posMax;if(92!==e.src.charCodeAt(r))return!1;if(++r=0;n--)95!==(r=t[n]).marker&&42!==r.marker||-1!==r.end&&(i=t[r.end],l=n>0&&t[n-1].end===r.end+1&&t[n-1].token===r.token-1&&t[r.end+1].token===i.token+1&&t[n-1].marker===r.marker,a=String.fromCharCode(r.marker),(o=e.tokens[r.token]).type=l?"strong_open":"em_open",o.tag=l?"strong":"em",o.nesting=1,o.markup=l?a+a:a,o.content="",(o=e.tokens[i.token]).type=l?"strong_close":"em_close",o.tag=l?"strong":"em",o.nesting=-1,o.markup=l?a+a:a,o.content="",l&&(e.tokens[t[n-1].token].content="",e.tokens[t[r.end+1].token].content="",n--))}Qg.tokenize=ie((function(e,t){var n,r,i=e.pos,o=e.src.charCodeAt(i);if(t)return!1;if(95!==o&&42!==o)return!1;for(r=e.scanDelims(e.pos,42===o),n=0;n=p)return!1;if(h=l,(s=e.md.helpers.parseLinkDestination(e.src,l,e.posMax)).ok){for(c=e.md.normalizeLink(s.str),e.md.validateLink(c)?l=s.pos:c="",h=l;l=p||41!==e.src.charCodeAt(l))&&(v=!0),l++}if(v){if("undefined"===typeof e.env.references)return!1;if(l=0?i=e.src.slice(h,l++):l=o+1):l=o+1,i||(i=e.src.slice(a,o)),!(u=e.env.references[Jg(i)]))return e.pos=f,!1;c=u.href,d=u.title}return t||(e.pos=a,e.posMax=o,e.push("link_open","a",1).attrs=n=[["href",c]],d&&n.push(["title",d]),e.md.inline.tokenize(e),e.push("link_close","a",-1)),e.pos=l,e.posMax=p,!0}),"link"),tb=Rv.normalizeReference,nb=Rv.isSpace,rb=ie((function(e,t){var n,r,i,o,a,l,s,u,c,d,f,p,h,v="",m=e.pos,g=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;if(l=e.pos+2,(a=e.md.helpers.parseLinkLabel(e,e.pos+1,!1))<0)return!1;if((s=a+1)=g)return!1;for(h=s,(c=e.md.helpers.parseLinkDestination(e.src,s,e.posMax)).ok&&(v=e.md.normalizeLink(c.str),e.md.validateLink(v)?s=c.pos:v=""),h=s;s=g||41!==e.src.charCodeAt(s))return e.pos=m,!1;s++}else{if("undefined"===typeof e.env.references)return!1;if(s=0?o=e.src.slice(h,s++):s=a+1):s=a+1,o||(o=e.src.slice(l,a)),!(u=e.env.references[tb(o)]))return e.pos=m,!1;v=u.href,d=u.title}return t||(i=e.src.slice(l,a),e.md.inline.parse(i,e.md,e.env,p=[]),(f=e.push("image","img",0)).attrs=n=[["src",v],["alt",""]],f.children=p,f.content=i,d&&n.push(["title",d])),e.pos=s,e.posMax=g,!0}),"image"),ib=/^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,ob=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/,ab=ie((function(e,t){var n,r,i,o,a,l,s=e.pos;if(60!==e.src.charCodeAt(s))return!1;for(a=e.pos,l=e.posMax;;){if(++s>=l)return!1;if(60===(o=e.src.charCodeAt(s)))return!1;if(62===o)break}return n=e.src.slice(a+1,s),ob.test(n)?(r=e.md.normalizeLink(n),!!e.md.validateLink(r)&&(t||((i=e.push("link_open","a",1)).attrs=[["href",r]],i.markup="autolink",i.info="auto",(i=e.push("text","",0)).content=e.md.normalizeLinkText(n),(i=e.push("link_close","a",-1)).markup="autolink",i.info="auto"),e.pos+=n.length+2,!0)):!!ib.test(n)&&(r=e.md.normalizeLink("mailto:"+n),!!e.md.validateLink(r)&&(t||((i=e.push("link_open","a",1)).attrs=[["href",r]],i.markup="autolink",i.info="auto",(i=e.push("text","",0)).content=e.md.normalizeLinkText(n),(i=e.push("link_close","a",-1)).markup="autolink",i.info="auto"),e.pos+=n.length+2,!0))}),"autolink"),lb=bg.HTML_TAG_RE;function sb(e){var t=32|e;return t>=97&&t<=122}ie(sb,"isLetter");var ub=ie((function(e,t){var n,r,i,o=e.pos;return!!e.md.options.html&&(i=e.posMax,!(60!==e.src.charCodeAt(o)||o+2>=i)&&(!(33!==(n=e.src.charCodeAt(o+1))&&63!==n&&47!==n&&!sb(n))&&(!!(r=e.src.slice(o).match(lb))&&(t||(e.push("html_inline","",0).content=e.src.slice(o,o+r[0].length)),e.pos+=r[0].length,!0))))}),"html_inline"),cb=Nv,db=Rv.has,fb=Rv.isValidEntityCode,pb=Rv.fromCodePoint,hb=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,vb=/^&([a-z][a-z0-9]{1,31});/i,mb=ie((function(e,t){var n,r,i=e.pos,o=e.posMax;if(38!==e.src.charCodeAt(i))return!1;if(i+1a;r-=o.jump+1)if((o=t[r]).marker===i.marker&&o.open&&o.end<0&&(s=!1,(o.close||i.open)&&(o.length+i.length)%3===0&&(o.length%3===0&&i.length%3===0||(s=!0)),!s)){u=r>0&&!t[r-1].open?t[r-1].jump+1:0,i.jump=n-r+u,i.open=!1,o.end=n,o.jump=u,o.close=!1,l=-1;break}-1!==l&&(c[i.marker][(i.open?3:0)+(i.length||0)%3]=l)}}ie(gb,"processDelimiters");var bb=ie((function(e){var t,n=e.tokens_meta,r=e.tokens_meta.length;for(gb(0,e.delimiters),t=0;t0&&r++,"text"===i[t].type&&t+10&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},Eb.prototype.scanDelims=function(e,t){var n,r,i,o,a,l,s,u,c,d=e,f=!0,p=!0,h=this.posMax,v=this.src.charCodeAt(e);for(n=e>0?this.src.charCodeAt(e-1):32;d=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Rb.prototype.parse=function(e,t,n,r){var i,o,a,l=new this.State(e,t,n,r);for(this.tokenize(l),a=(o=this.ruler2.getRules("")).length,i=0;i<\uff5c]|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+").|;(?!"+t.src_ZCc+").|\\!+(?!"+t.src_ZCc+"|[!]).|\\?(?!"+t.src_ZCc+"|[?]).)+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy='(^|[><\uff5c]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|"+t.src_ZPCc+"))((?![$+<=>^`|\uff5c])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|"+t.src_ZPCc+"))((?![$+<=>^`|\uff5c])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}),"re");function Mb(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach((function(t){t&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e}function Pb(e){return Object.prototype.toString.call(e)}function Db(e){return"[object String]"===Pb(e)}function Ab(e){return"[object Object]"===Pb(e)}function Zb(e){return"[object RegExp]"===Pb(e)}function jb(e){return"[object Function]"===Pb(e)}function Lb(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}ie(Mb,"assign"),ie(Pb,"_class"),ie(Db,"isString"),ie(Ab,"isObject"),ie(Zb,"isRegExp"),ie(jb,"isFunction"),ie(Lb,"escapeRE");var Fb={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function zb(e){return Object.keys(e||{}).reduce((function(e,t){return e||Fb.hasOwnProperty(t)}),!1)}ie(zb,"isOptionsObj");var Bb={"http:":{validate:function(e,t,n){var r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){var r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},Vb="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function Hb(e){e.__index__=-1,e.__text_cache__=""}function Ub(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function qb(){return function(e,t){t.normalize(e)}}function Wb(e){var t=e.re=Ob(e.__opts__),n=e.__tlds__.slice();function r(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||n.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),n.push(t.src_xn),t.src_tlds=n.join("|"),ie(r,"untpl"),t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");var i=[];function o(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},ie(o,"schemaError"),Object.keys(e.__schemas__).forEach((function(t){var n=e.__schemas__[t];if(null!==n){var r={validate:null,link:null};if(e.__compiled__[t]=r,Ab(n))return Zb(n.validate)?r.validate=Ub(n.validate):jb(n.validate)?r.validate=n.validate:o(t,n),void(jb(n.normalize)?r.normalize=n.normalize:n.normalize?o(t,n):r.normalize=function(e,t){t.normalize(e)});Db(n)?i.push(t):o(t,n)}})),i.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};var a=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(Lb).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><\uff5c]|"+t.src_ZPCc+"))("+a+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><\uff5c]|"+t.src_ZPCc+"))("+a+")","ig"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),Hb(e)}function Gb(e,t){var n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function Kb(e,t){var n=new Gb(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function $b(e,t){if(!(this instanceof $b))return new $b(e,t);t||zb(e)&&(t=e,e={}),this.__opts__=Mb({},Fb,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Mb({},Bb,e),this.__compiled__={},this.__tlds__=Vb,this.__tlds_replaced__=!1,this.re={},Wb(this)}ie(Hb,"resetScanCache"),ie(Ub,"createValidator"),ie(qb,"createNormalizer"),ie(Wb,"compile"),ie(Gb,"Match"),ie(Kb,"createMatch"),ie($b,"LinkifyIt$1"),$b.prototype.add=ie((function(e,t){return this.__schemas__[e]=t,Wb(this),this}),"add"),$b.prototype.set=ie((function(e){return this.__opts__=Mb(this.__opts__,e),this}),"set"),$b.prototype.test=ie((function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,n,r,i,o,a,l,s;if(this.re.schema_test.test(e))for((l=this.re.schema_search).lastIndex=0;null!==(t=l.exec(e));)if(i=this.testSchemaAt(e,t[2],l.lastIndex)){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(s=e.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||s=0&&null!==(r=e.match(this.re.email_fuzzy))&&(o=r.index+r[1].length,a=r.index+r[0].length,(this.__index__<0||othis.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=a)),this.__index__>=0}),"test"),$b.prototype.pretest=ie((function(e){return this.re.pretest.test(e)}),"pretest"),$b.prototype.testSchemaAt=ie((function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0}),"testSchemaAt"),$b.prototype.match=ie((function(e){var t=0,n=[];this.__index__>=0&&this.__text_cache__===e&&(n.push(Kb(this,t)),t=this.__last_index__);for(var r=t?e.slice(t):e;this.test(r);)n.push(Kb(this,t)),r=r.slice(this.__last_index__),t+=this.__last_index__;return n.length?n:null}),"match"),$b.prototype.tlds=ie((function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,n){return e!==n[t-1]})).reverse(),Wb(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Wb(this),this)}),"tlds"),$b.prototype.normalize=ie((function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)}),"normalize"),$b.prototype.onCompile=ie((function(){}),"onCompile");var Qb=$b,Yb=2147483647,Jb=36,Xb=/^xn--/,ey=/[^\0-\x7E]/,ty=/[\x2E\u3002\uFF0E\uFF61]/g,ny={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ry=Math.floor,iy=String.fromCharCode;function oy(e){throw new RangeError(ny[e])}function ay(e,t){for(var n=[],r=e.length;r--;)n[r]=t(e[r]);return n}function ly(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+ay((e=e.replace(ty,".")).split("."),t).join(".")}function sy(e){for(var t=[],n=0,r=e.length;n=55296&&i<=56319&&n>1,e+=ry(e/t);e>455;r+=Jb)e=ry(e/35);return ry(r+36*e/(e+38))}),"adapt"),py=ie((function(e){var t=[],n=e.length,r=0,i=128,o=72,a=e.lastIndexOf("-");a<0&&(a=0);for(var l=0;l=128&&oy("not-basic"),t.push(e.charCodeAt(l));for(var s=a>0?a+1:0;s=n&&oy("invalid-input");var f=cy(e.charCodeAt(s++));(f>=Jb||f>ry((Yb-r)/c))&&oy("overflow"),r+=f*c;var p=d<=o?1:d>=o+26?26:d-o;if(fry(Yb/h)&&oy("overflow"),c*=h}var v=t.length+1;o=fy(r-u,v,0==u),ry(r/v)>Yb-i&&oy("overflow"),i+=ry(r/v),r%=v,t.splice(r++,0,i)}return String.fromCodePoint.apply(String,t)}),"decode"),hy=ie((function(e){var t,n=[],r=(e=sy(e)).length,i=128,o=0,a=72,l=(0,p.Z)(e);try{for(l.s();!(t=l.n()).done;){var s=t.value;s<128&&n.push(iy(s))}}catch(TS){l.e(TS)}finally{l.f()}var u=n.length,c=u;for(u&&n.push("-");c=i&&vry((Yb-o)/m)&&oy("overflow"),o+=(f-i)*m,i=f;var g,b=(0,p.Z)(e);try{for(b.s();!(g=b.n()).done;){var y=g.value;if(yYb&&oy("overflow"),y==i){for(var x=o,w=Jb;;w+=Jb){var C=w<=a?1:w>=a+26?26:w-a;if(x=0))try{t.hostname=_y.toASCII(t.hostname)}catch(n){}return Ty.encode(Ty.format(t))}function Dy(e){var t=Ty.parse(e,!0);if(t.hostname&&(!t.protocol||My.indexOf(t.protocol)>=0))try{t.hostname=_y.toUnicode(t.hostname)}catch(n){}return Ty.decode(Ty.format(t),Ty.decode.defaultChars+"%")}function Ay(e,t){if(!(this instanceof Ay))return new Ay(e,t);t||yy.isString(e)||(t=e||{},e="default"),this.inline=new Ey,this.block=new ky,this.core=new Cy,this.renderer=new wy,this.linkify=new Sy,this.validateLink=Oy,this.normalizeLink=Py,this.normalizeLinkText=Dy,this.utils=yy,this.helpers=yy.assign({},xy),this.options={},this.configure(e),t&&this.set(t)}ie(Py,"normalizeLink"),ie(Dy,"normalizeLinkText"),ie(Ay,"MarkdownIt"),Ay.prototype.set=function(e){return yy.assign(this.options,e),this},Ay.prototype.configure=function(e){var t,n=this;if(yy.isString(e)&&!(e=Iy[t=e]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&n.set(e.options),e.components&&Object.keys(e.components).forEach((function(t){e.components[t].rules&&n[t].ruler.enableOnly(e.components[t].rules),e.components[t].rules2&&n[t].ruler2.enableOnly(e.components[t].rules2)})),this},Ay.prototype.enable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.enable(e,!0))}),this),n=n.concat(this.inline.ruler2.enable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},Ay.prototype.disable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.disable(e,!0))}),this),n=n.concat(this.inline.ruler2.disable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},Ay.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},Ay.prototype.parse=function(e,t){if("string"!==typeof e)throw new Error("Input data should be a String");var n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},Ay.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},Ay.prototype.parseInline=function(e,t){var n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},Ay.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};var Zy=new Ay({breaks:!0,linkify:!0}),jy=(0,g.forwardRef)((function(e,t){var n=e,r=n.children,i=n.onlyShowFirstChild,o=n.type,a=oe(n,["children","onlyShowFirstChild","type"]);return Xe("div",re(ne({},a),{ref:t,className:le("graphiql-markdown-".concat(o),i&&"graphiql-markdown-preview",a.className),dangerouslySetInnerHTML:{__html:Zy.render(r)}}))}));jy.displayName="MarkdownContent";var Ly=(0,g.forwardRef)((function(e,t){return Xe("div",re(ne({},e),{ref:t,className:le("graphiql-spinner",e.className)}))}));Ly.displayName="Spinner";function Fy(e){var t,n,r=Xl(e),i=r.defaultView||window;return r?{width:null!=(t=r.documentElement.clientWidth)?t:i.innerWidth,height:null!=(n=r.documentElement.clientHeight)?n:i.innerHeight}:{width:0,height:0}}function zy(){return zy=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}ie(Fy,"getDocumentDimensions"),ie(zy,"_extends$1"),ie(By,"_objectWithoutPropertiesLoose$1");var Vy,Hy,Uy,qy,Wy,Gy,Ky,$y,Qy,Yy,Jy=["children","label","ariaLabel","id","DEBUG_STYLE"],Xy=["label","ariaLabel","isVisible","id"],ex=["ariaLabel","aria-label","as","id","isVisible","label","position","style","triggerRect"],tx=["type"];($y=Ky||(Ky={})).Idle="IDLE",$y.Focused="FOCUSED",$y.Visible="VISIBLE",$y.LeavingVisible="LEAVING_VISIBLE",$y.Dismissed="DISMISSED",(Yy=Qy||(Qy={})).Blur="BLUR",Yy.Focus="FOCUS",Yy.GlobalMouseMove="GLOBAL_MOUSE_MOVE",Yy.MouseDown="MOUSE_DOWN",Yy.MouseEnter="MOUSE_ENTER",Yy.MouseLeave="MOUSE_LEAVE",Yy.MouseMove="MOUSE_MOVE",Yy.Rest="REST",Yy.SelectWithKeyboard="SELECT_WITH_KEYBOARD",Yy.TimeComplete="TIME_COMPLETE";var nx,rx,ix={initial:Ky.Idle,states:(Gy={},Gy[Ky.Idle]={enter:px,on:(Vy={},Vy[Qy.MouseEnter]=Ky.Focused,Vy[Qy.Focus]=Ky.Visible,Vy)},Gy[Ky.Focused]={enter:ux,leave:cx,on:(Hy={},Hy[Qy.MouseMove]=Ky.Focused,Hy[Qy.MouseLeave]=Ky.Idle,Hy[Qy.MouseDown]=Ky.Dismissed,Hy[Qy.Blur]=Ky.Idle,Hy[Qy.Rest]=Ky.Visible,Hy)},Gy[Ky.Visible]={on:(Uy={},Uy[Qy.Focus]=Ky.Focused,Uy[Qy.MouseEnter]=Ky.Focused,Uy[Qy.MouseLeave]=Ky.LeavingVisible,Uy[Qy.Blur]=Ky.LeavingVisible,Uy[Qy.MouseDown]=Ky.Dismissed,Uy[Qy.SelectWithKeyboard]=Ky.Dismissed,Uy[Qy.GlobalMouseMove]=Ky.LeavingVisible,Uy)},Gy[Ky.LeavingVisible]={enter:dx,leave:ie((function(){fx(),px()}),"leave"),on:(qy={},qy[Qy.MouseEnter]=Ky.Visible,qy[Qy.Focus]=Ky.Visible,qy[Qy.TimeComplete]=Ky.Idle,qy)},Gy[Ky.Dismissed]={leave:ie((function(){px()}),"leave"),on:(Wy={},Wy[Qy.MouseLeave]=Ky.Idle,Wy[Qy.Blur]=Ky.Idle,Wy)},Gy)},ox={value:ix.initial,context:{id:null}},ax=[];function lx(e){return ax.push(e),function(){ax.splice(ax.indexOf(e),1)}}function sx(){ax.forEach((function(e){return e(ox)}))}function ux(){window.clearTimeout(nx),nx=window.setTimeout((function(){wx({type:Qy.Rest})}),100)}function cx(){window.clearTimeout(nx)}function dx(){window.clearTimeout(rx),rx=window.setTimeout((function(){return wx({type:Qy.TimeComplete})}),500)}function fx(){window.clearTimeout(rx)}function px(){ox.context.id=null}function hx(e){var t=void 0===e?{}:e,n=t.id,r=t.onPointerEnter,i=t.onPointerMove,o=t.onPointerLeave,a=t.onPointerDown,l=t.onMouseEnter,s=t.onMouseMove,u=t.onMouseLeave,c=t.onMouseDown,d=t.onFocus,f=t.onBlur,p=t.onKeyDown,h=t.disabled,v=t.ref,m=t.DEBUG_STYLE,b=String(zd(n)),y=(0,g.useState)(!!m||kx(b,!0)),x=y[0],w=y[1],C=(0,g.useRef)(null),k=ss(v,C),E=Gd(C,{observe:x});function S(e,t){return"undefined"!==typeof window&&"PointerEvent"in window?e:us(e,t)}function T(e){return ie((function(t){"mouse"===t.pointerType&&e(t)}),"onPointerEvent")}function _(){wx({type:Qy.MouseEnter,id:b})}function I(){wx({type:Qy.MouseMove,id:b})}function R(){wx({type:Qy.MouseLeave})}function N(){ox.context.id===b&&wx({type:Qy.MouseDown})}function O(){window.__REACH_DISABLE_TOOLTIPS||wx({type:Qy.Focus,id:b})}function M(){ox.context.id===b&&wx({type:Qy.Blur})}function P(e){"Enter"!==e.key&&" "!==e.key||wx({type:Qy.SelectWithKeyboard})}return(0,g.useEffect)((function(){return lx((function(){w(kx(b))}))}),[b]),(0,g.useEffect)((function(){var e=Xl(C.current);function t(e){"Escape"!==e.key&&"Esc"!==e.key||ox.value!==Ky.Visible||wx({type:Qy.SelectWithKeyboard})}return ie(t,"listener"),e.addEventListener("keydown",t),function(){return e.removeEventListener("keydown",t)}}),[]),xx({disabled:h,isVisible:x,ref:C}),ie(S,"wrapMouseEvent"),ie(T,"wrapPointerEventHandler"),ie(_,"handleMouseEnter"),ie(I,"handleMouseMove"),ie(R,"handleMouseLeave"),ie(N,"handleMouseDown"),ie(O,"handleFocus"),ie(M,"handleBlur"),ie(P,"handleKeyDown"),[{"aria-describedby":x?qf("tooltip",b):void 0,"data-state":x?"tooltip-visible":"tooltip-hidden","data-reach-tooltip-trigger":"",ref:k,onPointerEnter:us(r,T(_)),onPointerMove:us(i,T(I)),onPointerLeave:us(o,T(R)),onPointerDown:us(a,T(N)),onMouseEnter:S(l,_),onMouseMove:S(s,I),onMouseLeave:S(u,R),onMouseDown:S(c,N),onFocus:us(d,O),onBlur:us(f,M),onKeyDown:us(p,P)},{id:b,triggerRect:E,isVisible:x},x]}ie(lx,"subscribe"),ie(sx,"notify"),ie(ux,"startRestTimer"),ie(cx,"clearRestTimer"),ie(dx,"startLeavingVisibleTimer"),ie(fx,"clearLeavingVisibleTimer"),ie(px,"clearContextId"),ie(hx,"useTooltip");var vx=(0,g.forwardRef)((function(e,t){var n=e.children,r=e.label,i=e.ariaLabel,o=e.id,a=e.DEBUG_STYLE,l=By(e,Jy),s=g.Children.only(n),u=hx({id:o,onPointerEnter:s.props.onPointerEnter,onPointerMove:s.props.onPointerMove,onPointerLeave:s.props.onPointerLeave,onPointerDown:s.props.onPointerDown,onMouseEnter:s.props.onMouseEnter,onMouseMove:s.props.onMouseMove,onMouseLeave:s.props.onMouseLeave,onMouseDown:s.props.onMouseDown,onFocus:s.props.onFocus,onBlur:s.props.onBlur,onKeyDown:s.props.onKeyDown,disabled:s.props.disabled,ref:s.ref,DEBUG_STYLE:a}),c=u[0],d=u[1];return(0,g.createElement)(g.Fragment,null,(0,g.cloneElement)(s,c),(0,g.createElement)(mx,zy({ref:t,label:r,"aria-label":i},d,l)))})),mx=(0,g.forwardRef)(ie((function(e,t){var n=e.label,r=e.ariaLabel,i=e.isVisible,o=e.id,a=By(e,Xy);return i?(0,g.createElement)(Jl,null,(0,g.createElement)(gx,zy({ref:t,label:n,"aria-label":r,isVisible:i},a,{id:qf("tooltip",String(o))}))):null}),"TooltipPopup")),gx=(0,g.forwardRef)(ie((function(e,t){var n=e.ariaLabel,r=e["aria-label"],i=e.as,o=void 0===i?"div":i,a=e.id,l=e.isVisible,s=e.label,u=e.position,c=void 0===u?yx:u,d=e.style,f=e.triggerRect,p=By(e,ex),h=null!=(r||n),v=(0,g.useRef)(null),m=ss(t,v),b=Gd(v,{observe:l});return(0,g.createElement)(g.Fragment,null,(0,g.createElement)(o,zy({role:h?void 0:"tooltip"},p,{ref:m,"data-reach-tooltip":"",id:h?void 0:a,style:zy({},d,bx(c,f,b))}),s),h&&(0,g.createElement)(Od,{role:"tooltip",id:a},r||n))}),"TooltipContent"));function bx(e,t,n){return!n?{visibility:"hidden"}:e(t,n)}ie(bx,"getStyles");var yx=ie((function(e,t,n){void 0===n&&(n=8);var r=Fy(),i=r.width,o=r.height;if(!e||!t)return{};var a={top:e.top-t.height<0,right:i0&&(s+="\n"+S.map((function(e){return(0,V.print)(e)})).join("\n")),i(""),E(!0),T=null!=(n=null!=o?o:c.operationName)?n:void 0,null==y||y.addToHistory({query:s,variables:g,headers:C,operationName:T}),e.prev=32,O={data:{}},M=Bx((function(e){if(a===R.current){var t=!!Array.isArray(e)&&e;if(!t&&"object"===typeof e&&null!==e&&"hasNext"in e&&(t=[e]),t){var n={data:O.data},r=[].concat((0,f.Z)((null==O?void 0:O.errors)||[]),(0,f.Z)(t.flatMap((function(e){return e.errors})).filter(Boolean)));r.length&&(n.errors=r);var o,l=(0,p.Z)(t);try{for(l.s();!(o=l.n()).done;){var s=o.value,u=s,c=u.path,d=u.data,h=(u.errors,oe(u,["path","data","errors"]));if(c){if(!d)throw new Error("Expected part to contain a data property, but got ".concat(s));Pa(n.data,c,d,{merge:!0})}else d&&(n.data=d);O=ne(ne({},n),h)}}catch(TS){l.e(TS)}finally{l.f()}E(!1),i(ye(O))}else{var v=ye(e);E(!1),i(v)}}}),"handleResponse"),P=t({query:s,variables:w,operationName:T},{headers:null!=k?k:void 0,documentAST:null!=(r=c.documentAST)?r:void 0}),e.next=38,Promise.resolve(P);case 38:if(!ce(D=e.sent)){e.next=43;break}I(D.subscribe({next:function(e){M(e)},error:function(e){E(!1),e&&i(be(e)),I(null)},complete:function(){E(!1),I(null)}})),e.next=78;break;case 43:if(!de(D)){e.next=77;break}I({unsubscribe:function(){var e,t;return null==(t=(e=D[Symbol.asyncIterator]()).return)?void 0:t.call(e)}}),A=!1,Z=!1,e.prev=47,L=(0,h.Z)(D);case 49:return e.next=51,L.next();case 51:if(!(A=!(F=e.sent).done)){e.next=57;break}z=F.value,M(z);case 54:A=!1,e.next=49;break;case 57:e.next=63;break;case 59:e.prev=59,e.t2=e.catch(47),Z=!0,j=e.t2;case 63:if(e.prev=63,e.prev=64,!A||null==L.return){e.next=68;break}return e.next=68,L.return();case 68:if(e.prev=68,!Z){e.next=71;break}throw j;case 71:return e.finish(68);case 72:return e.finish(63);case 73:E(!1),I(null),e.next=78;break;case 77:M(D);case 78:e.next=85;break;case 80:e.prev=80,e.t3=e.catch(32),E(!1),i(be(e.t3)),I(null);case 85:case"end":return e.stop()}}),e,null,[[10,14],[19,23],[32,80],[47,59,63,73],[64,,68,72]])}))),[x,l,t,u,y,o,c,d,N,_,b,v]),M=Boolean(_),P=(0,g.useMemo)((function(){return{isFetching:k,isSubscribed:M,operationName:null!=o?o:null,run:O,stop:N}}),[k,M,o,O,N]);return Xe(Vx.Provider,{value:P,children:i})}ie(Hx,"ExecutionContextProvider"),Bx(Hx,"ExecutionContextProvider");var Ux=Le(Vx);function qx(e){var t=e.json,n=e.errorMessageParse,r=e.errorMessageType,i=void 0;try{i=t&&""!==t.trim()?JSON.parse(t):void 0}catch(a){throw new Error("".concat(n,": ").concat(a instanceof Error?a.message:a,"."))}var o="object"===typeof i&&null!==i&&!Array.isArray(i);if(void 0!==i&&!o)throw new Error(r);return i}ie(qx,"tryParseJsonObject"),Bx(qx,"tryParseJsonObject");var Wx=Object.defineProperty,Gx=ie((function(e,t){return Wx(e,"name",{value:t,configurable:!0})}),"__name$z"),Kx="graphiql",$x="sublime",Qx=!1;"object"===typeof window&&(Qx=0===window.navigator.platform.toLowerCase().indexOf("mac"));var Yx=(F={},(0,u.Z)(F,Qx?"Cmd-F":"Ctrl-F","findPersistent"),(0,u.Z)(F,"Cmd-G","findPersistent"),(0,u.Z)(F,"Ctrl-G","findPersistent"),(0,u.Z)(F,"Ctrl-Left","goSubwordLeft"),(0,u.Z)(F,"Ctrl-Right","goSubwordRight"),(0,u.Z)(F,"Alt-Left","goGroupLeft"),(0,u.Z)(F,"Alt-Right","goGroupRight"),F);function Jx(e,t){return Xx.apply(this,arguments)}function Xx(){return Xx=(0,r.Z)(m().mark((function e(t,r){var i;return m().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.e(461).then(n.bind(n,8461)).then((function(e){return e.c})).then((function(e){return"function"===typeof e?e:e.default}));case 2:return i=e.sent,e.next=5,Promise.all(!1===(null==r?void 0:r.useCommonAddons)?t:[Promise.all([n.e(461),n.e(80)]).then(n.bind(n,4080)).then((function(e){return e.s})),Promise.all([n.e(461),n.e(990)]).then(n.bind(n,5990)).then((function(e){return e.m})),Promise.all([n.e(461),n.e(939)]).then(n.bind(n,1939)).then((function(e){return e.c})),Promise.all([n.e(461),n.e(474)]).then(n.bind(n,6474)).then((function(e){return e.b})),Promise.all([n.e(461),n.e(986)]).then(n.bind(n,986)).then((function(e){return e.f})),Promise.all([n.e(461),n.e(714)]).then(n.bind(n,2714)).then((function(e){return e.l})),Promise.all([n.e(461),n.e(822)]).then(n.bind(n,9822)).then((function(e){return e.s})),Promise.all([n.e(461),n.e(491)]).then(n.bind(n,4491)).then((function(e){return e.j})),Promise.all([n.e(461),n.e(301)]).then(n.bind(n,3301)).then((function(e){return e.d})),Promise.all([n.e(461),n.e(492)]).then(n.bind(n,6492)).then((function(e){return e.s}))].concat((0,f.Z)(t)));case 5:return e.abrupt("return",i);case 6:case"end":return e.stop()}}),e)}))),Xx.apply(this,arguments)}ie(Jx,"importCodeMirror"),Gx(Jx,"importCodeMirror");var ew=ie((function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r1?e.slice(0,-1):e}))}),[]),d=(0,g.useCallback)((function(){l((function(e){return 1===e.length?e:[yw]}))}),[]);(0,g.useEffect)((function(){null==n||r.length>0?d():l((function(e){if(1===e.length)return e;var t,r=[yw],i=null,o=(0,p.Z)(e);try{var a=function(){var e=t.value;if(e===yw)return"continue";if(e.def)if((0,I.Zs)(e.def)){var o=n.getType(e.def.name);if(!o)return"break";r.push({name:e.name,def:o}),i=o}else{if(null===i)return"break";if((0,I.lp)(i)||(0,I.hL)(i)){var a=i.getFields()[e.name];if(!a)return"break";r.push({name:e.name,def:a})}else{if((0,I.KA)(i)||(0,I.EM)(i)||(0,I.oT)(i)||(0,I.EN)(i))return"break";var l=i;if(!l.args.find((function(t){return t.name===e.name})))return"break";r.push({name:e.name,def:l})}}else i=null,r.push(e)};for(o.s();!(t=o.n()).done;){var l=a();if("continue"!==l&&"break"===l)break}}catch(TS){o.e(TS)}finally{o.f()}return r}))}),[d,n,r]);var h=(0,g.useMemo)((function(){return{explorerNavStack:a,push:u,pop:c,reset:d}}),[a,u,c,d]);return Xe(xw.Provider,{value:h,children:e.children})}ie(ww,"ExplorerContextProvider"),bw(ww,"ExplorerContextProvider");var Cw=Le(xw),kw=Object.defineProperty,Ew=ie((function(e,t){return kw(e,"name",{value:t,configurable:!0})}),"__name$v");function Sw(e,t){return(0,I.zM)(e)?et(tt,{children:[Sw(e.ofType,t),"!"]}):(0,I.HG)(e)?et(tt,{children:["[",Sw(e.ofType,t),"]"]}):t(e)}ie(Sw,"renderType"),Ew(Sw,"renderType");var Tw=Object.defineProperty,_w=ie((function(e,t){return Tw(e,"name",{value:t,configurable:!0})}),"__name$u");function Iw(e){var t=Cw({nonNull:!0,caller:Iw}).push;return e.type?Sw(e.type,(function(e){return Xe("a",{className:"graphiql-doc-explorer-type-name",onClick:function(n){n.preventDefault(),t({name:e.name,def:e})},href:"#",children:e.name})})):null}ie(Iw,"TypeLink"),_w(Iw,"TypeLink");var Rw=Object.defineProperty,Nw=ie((function(e,t){return Rw(e,"name",{value:t,configurable:!0})}),"__name$t");function Ow(e){var t=e.arg,n=e.showDefaultValue,r=e.inline,i=et("span",{children:[Xe("span",{className:"graphiql-doc-explorer-argument-name",children:t.name}),": ",Xe(Iw,{type:t.type}),!1!==n&&Xe(uw,{field:t})]});return r?i:et("div",{className:"graphiql-doc-explorer-argument",children:[i,t.description?Xe(jy,{type:"description",children:t.description}):null,t.deprecationReason?et("div",{className:"graphiql-doc-explorer-argument-deprecation",children:[Xe("div",{className:"graphiql-doc-explorer-argument-deprecation-label",children:"Deprecated"}),Xe(jy,{type:"deprecation",children:t.deprecationReason})]}):null]})}ie(Ow,"Argument"),Nw(Ow,"Argument");var Mw=Object.defineProperty,Pw=ie((function(e,t){return Mw(e,"name",{value:t,configurable:!0})}),"__name$s");function Dw(e){return e.children?et("div",{className:"graphiql-doc-explorer-deprecation",children:[Xe("div",{className:"graphiql-doc-explorer-deprecation-label",children:"Deprecated"}),Xe(jy,{type:"deprecation",onlyShowFirstChild:!0,children:e.children})]}):null}ie(Dw,"DeprecationReason"),Pw(Dw,"DeprecationReason");var Aw=Object.defineProperty,Zw=ie((function(e,t){return Aw(e,"name",{value:t,configurable:!0})}),"__name$r");function jw(e){var t=e.directive;return et("span",{className:"graphiql-doc-explorer-directive",children:["@",t.name.value]})}ie(jw,"Directive"),Zw(jw,"Directive");var Lw=Object.defineProperty,Fw=ie((function(e,t){return Lw(e,"name",{value:t,configurable:!0})}),"__name$q");function zw(e){var t=Bw[e.title];return et("div",{children:[et("div",{className:"graphiql-doc-explorer-section-title",children:[Xe(t,{}),e.title]}),Xe("div",{className:"graphiql-doc-explorer-section-content",children:e.children})]})}ie(zw,"ExplorerSection"),Fw(zw,"ExplorerSection");var Bw={Arguments:fl,"Deprecated Arguments":bl,"Deprecated Enum Values":yl,"Deprecated Fields":xl,Directives:wl,"Enum Values":El,Fields:Sl,Implements:_l,Implementations:Bl,"Possible Types":Bl,"Root Types":Zl,Type:Bl},Vw=Object.defineProperty,Hw=ie((function(e,t){return Vw(e,"name",{value:t,configurable:!0})}),"__name$p");function Uw(e){return et(tt,{children:[e.field.description?Xe(jy,{type:"description",children:e.field.description}):null,Xe(Dw,{children:e.field.deprecationReason}),Xe(zw,{title:"Type",children:Xe(Iw,{type:e.field.type})}),Xe(qw,{field:e.field}),Xe(Ww,{field:e.field})]})}function qw(e){var t=e.field,n=(0,g.useState)(!1),r=(0,s.Z)(n,2),i=r[0],o=r[1];if(!("args"in t))return null;var a,l=[],u=[],c=(0,p.Z)(t.args);try{for(c.s();!(a=c.n()).done;){var d=a.value;d.deprecationReason?u.push(d):l.push(d)}}catch(TS){c.e(TS)}finally{c.f()}return et(tt,{children:[l.length>0?Xe(zw,{title:"Arguments",children:l.map((function(e){return Xe(Ow,{arg:e},e.name)}))}):null,u.length>0?i||0===l.length?Xe(zw,{title:"Deprecated Arguments",children:u.map((function(e){return Xe(Ow,{arg:e},e.name)}))}):Xe(Ul,{type:"button",onClick:function(){o(!0)},children:"Show Deprecated Arguments"}):null]})}function Ww(e){var t,n=(null==(t=e.field.astNode)?void 0:t.directives)||[];return n&&0!==n.length?Xe(zw,{title:"Directives",children:n.map((function(e){return Xe("div",{children:Xe(jw,{directive:e})},e.name.value)}))}):null}ie(Uw,"FieldDocumentation"),Hw(Uw,"FieldDocumentation"),ie(qw,"Arguments"),Hw(qw,"Arguments"),ie(Ww,"Directives"),Hw(Ww,"Directives");var Gw=Object.defineProperty,Kw=ie((function(e,t){return Gw(e,"name",{value:t,configurable:!0})}),"__name$o");function $w(e){var t,n,r,i,o=e.schema.getQueryType(),a=null==(n=(t=e.schema).getMutationType)?void 0:n.call(t),l=null==(i=(r=e.schema).getSubscriptionType)?void 0:i.call(r);return et(tt,{children:[Xe(jy,{type:"description",children:e.schema.description||"A GraphQL schema provides a root type for each kind of operation."}),et(zw,{title:"Root Types",children:[o?et("div",{children:[Xe("span",{className:"graphiql-doc-explorer-root-type",children:"query"}),": ",Xe(Iw,{type:o})]}):null,a&&et("div",{children:[Xe("span",{className:"graphiql-doc-explorer-root-type",children:"mutation"}),": ",Xe(Iw,{type:a})]}),l&&et("div",{children:[Xe("span",{className:"graphiql-doc-explorer-root-type",children:"subscription"}),": ",Xe(Iw,{type:l})]})]})]})}function Qw(e,t){var n=(0,g.useRef)(!1);(0,g.useEffect)((function(){n.current?e():n.current=!0}),t)}function Yw(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}function Jw(){return Jw=Object.assign||function(e){for(var t=1;ts&&e.push({highlight:!1,start:s,end:u}),o.index===l.lastIndex&&l.lastIndex++}return e}),[])}function nC(e){var t=e.chunksToHighlight,n=e.totalLength,r=[];if(0===t.length)o(0,n,!1);else{var i=0;t.forEach((function(e){o(i,e.start,!1),o(e.start,e.end,!0),i=e.end})),o(i,n,!1)}return r;function o(e,t,n){t-e>0&&r.push({start:e,end:t,highlight:n})}}function rC(e){return e}function iC(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}ie($w,"SchemaDocumentation"),Kw($w,"SchemaDocumentation"),ie(Qw,"useUpdateEffect"),ie(Yw,"_objectWithoutPropertiesLoose"),ie(Jw,"_extends"),ie(Xw,"findAll"),ie(eC,"combineChunks"),ie(tC,"defaultFindChunks"),ie(nC,"fillInChunks"),ie(rC,"defaultSanitize"),ie(iC,"escapeRegExpFn");var oC,aC,lC,sC,uC,cC={combineChunks:eC,fillInChunks:nC,findAll:Xw,findChunks:tC},dC=["onSelect","openOnFocus","children","as","aria-label","aria-labelledby"],fC=["as","selectOnClick","autocomplete","onClick","onChange","onKeyDown","onBlur","onFocus","value"],pC=["as","children","portal","onKeyDown","onBlur","position"],hC=["persistSelection","as"],vC=["as","children","index","value","onClick"],mC="IDLE",gC="SUGGESTING",bC="NAVIGATING",yC="INTERACTING",xC="CLEAR",wC="CHANGE",CC="INITIAL_CHANGE",kC="NAVIGATE",EC="SELECT_WITH_KEYBOARD",SC="SELECT_WITH_CLICK",TC="ESCAPE",_C="BLUR",IC="INTERACT",RC="FOCUS",NC="OPEN_WITH_BUTTON",OC="OPEN_WITH_INPUT_CLICK",MC="CLOSE_WITH_BUTTON",PC={initial:mC,states:(uC={},uC.IDLE={on:(oC={},oC.BLUR=mC,oC.CLEAR=mC,oC.CHANGE=gC,oC.INITIAL_CHANGE=mC,oC.FOCUS=gC,oC.NAVIGATE=bC,oC.OPEN_WITH_BUTTON=gC,oC.OPEN_WITH_INPUT_CLICK=gC,oC)},uC[gC]={on:(aC={},aC.CHANGE=gC,aC.FOCUS=gC,aC.NAVIGATE=bC,aC.CLEAR=mC,aC.ESCAPE=mC,aC.BLUR=mC,aC.SELECT_WITH_CLICK=mC,aC.INTERACT=yC,aC.CLOSE_WITH_BUTTON=mC,aC)},uC[bC]={on:(lC={},lC.CHANGE=gC,lC.FOCUS=gC,lC.CLEAR=mC,lC.BLUR=mC,lC.ESCAPE=mC,lC.NAVIGATE=bC,lC.SELECT_WITH_CLICK=mC,lC.SELECT_WITH_KEYBOARD=mC,lC.CLOSE_WITH_BUTTON=mC,lC.INTERACT=yC,lC)},uC[yC]={on:(sC={},sC.CLEAR=mC,sC.CHANGE=gC,sC.FOCUS=gC,sC.BLUR=mC,sC.ESCAPE=mC,sC.NAVIGATE=bC,sC.CLOSE_WITH_BUTTON=mC,sC.SELECT_WITH_CLICK=mC,sC)},uC)},DC=ie((function(e,t){var n=Jw({},e,{lastEventType:t.type});switch(t.type){case wC:case CC:return Jw({},n,{navigationValue:null,value:t.value});case kC:case NC:case OC:return Jw({},n,{navigationValue:ZC(n,t)});case xC:return Jw({},n,{value:"",navigationValue:null});case _C:case TC:return Jw({},n,{navigationValue:null});case SC:return Jw({},n,{value:t.isControlled?e.value:t.value,navigationValue:null});case EC:return Jw({},n,{value:t.isControlled?e.value:e.navigationValue,navigationValue:null});case MC:return Jw({},n,{navigationValue:null});case IC:return n;case RC:return Jw({},n,{navigationValue:ZC(n,t)});default:return n}}),"reducer");function AC(e){return[gC,bC,yC].includes(e)}function ZC(e,t){return t.value?t.value:t.persistSelection?e.value:null}ie(AC,"popoverIsExpanded"),ie(ZC,"findNavigationValue");var jC=Nf(),LC=Hf(0,{}),FC=Hf(0,{}),zC=(0,g.forwardRef)((function(e,t){var n,r=e.onSelect,i=e.openOnFocus,o=void 0!==i&&i,a=e.children,l=e.as,s=void 0===l?"div":l,u=e["aria-label"],c=e["aria-labelledby"],d=Yw(e,dC),f=Mf(),p=f[0],h=f[1],v=(0,g.useRef)(),m=(0,g.useRef)(),b=(0,g.useRef)(),y=(0,g.useRef)(!1),x=(0,g.useRef)(!1),w=$C(PC,DC,{value:"",navigationValue:null}),C=w[0],k=w[1],E=w[2];WC(k.lastEventType,v);var S=zd(d.id),T=S?qf("listbox",S):"listbox",_=(0,g.useRef)(!1),I=AC(C),R={ariaLabel:u,ariaLabelledby:c,autocompletePropRef:y,buttonRef:b,comboboxId:S,data:k,inputRef:v,isExpanded:I,listboxId:T,onSelect:r||rs,openOnFocus:o,persistSelectionRef:x,popoverRef:m,state:C,transition:E,isControlledRef:_};return(0,g.createElement)(Df,{context:jC,items:p,set:h},(0,g.createElement)(LC.Provider,{value:R},(0,g.createElement)(s,Jw({},d,{"data-reach-combobox":"","data-state":YC(C),"data-expanded":I||void 0,ref:t}),ts(a)?a({id:S,isExpanded:I,navigationValue:null!=(n=k.navigationValue)?n:null,state:C}):a)))})),BC=(0,g.forwardRef)((function(e,t){var n=e.as,r=void 0===n?"input":n,i=e.selectOnClick,o=void 0!==i&&i,a=e.autocomplete,l=void 0===a||a,s=e.onClick,u=e.onChange,c=e.onKeyDown,d=e.onBlur,f=e.onFocus,p=e.value,h=Yw(e,fC),v=(0,g.useRef)(p).current,m=(0,g.useRef)(!1);Qw((function(){m.current=!0}),[p]);var b=(0,g.useContext)(LC),y=b.data,x=y.navigationValue,w=y.value,C=y.lastEventType,k=b.inputRef,E=b.state,S=b.transition,T=b.listboxId,_=b.autocompletePropRef,I=b.openOnFocus,R=b.isExpanded,N=b.ariaLabel,O=b.ariaLabelledby,M=b.persistSelectionRef,P=b.isControlledRef,D=ss(k,t),A=(0,g.useRef)(!1),Z=GC(),j=KC(),L="undefined"!==typeof p;(0,g.useEffect)((function(){P.current=L}),[L]),Gl((function(){_.current=l}),[l,_]);var F=(0,g.useCallback)((function(e){""===e.trim()?S(xC,{isControlled:L}):e!==v||m.current?S(wC,{value:e}):S(CC,{value:e})}),[v,S,L]);function z(e){var t=e.target.value;L||F(t)}function B(){o&&(A.current=!0),I&&C!==SC&&S(RC,{persistSelection:M.current})}function V(){var e;A.current&&(A.current=!1,null==(e=k.current)||e.select());I&&E===mC&&S(OC)}(0,g.useEffect)((function(){!L||p===w||""===p.trim()&&""===(w||"").trim()||F(p)}),[p,F,L,w]),ie(z,"handleChange"),ie(B,"handleFocus"),ie(V,"handleClick");var H=!l||E!==bC&&E!==yC?p||w:x||p||w;return(0,g.createElement)(r,Jw({"aria-activedescendant":x?String(QC(x)):void 0,"aria-autocomplete":"both","aria-controls":T,"aria-expanded":R,"aria-haspopup":"listbox","aria-label":N,"aria-labelledby":N?void 0:O,role:"combobox"},h,{"data-reach-combobox-input":"","data-state":YC(E),ref:D,onBlur:us(d,j),onChange:us(u,z),onClick:us(s,V),onFocus:us(f,B),onKeyDown:us(c,Z),value:H||""}))})),VC=(0,g.forwardRef)((function(e,t){var n=e.as,r=void 0===n?"div":n,i=e.children,o=e.portal,a=void 0===o||o,l=e.onKeyDown,s=e.onBlur,u=e.position,c=void 0===u?Ef:u,d=Yw(e,pC),f=(0,g.useContext)(LC),p=f.popoverRef,h=f.inputRef,v=f.isExpanded,m=f.state,b=ss(p,t),y=GC(),x=KC(),w={"data-reach-combobox-popover":"","data-state":YC(m),onKeyDown:us(l,y),onBlur:us(s,x),hidden:!v,tabIndex:-1,children:i};return a?(0,g.createElement)(yf,Jw({as:r},d,{ref:b,"data-expanded":v||void 0,position:c,targetRef:h,unstable_skipInitialPortalRender:!0},w)):(0,g.createElement)(r,Jw({ref:b},d,w))})),HC=(0,g.forwardRef)((function(e,t){var n=e.persistSelection,r=void 0!==n&&n,i=e.as,o=void 0===i?"ul":i,a=Yw(e,hC),l=(0,g.useContext)(LC),s=l.persistSelectionRef,u=l.listboxId;return r&&(s.current=!0),(0,g.createElement)(o,Jw({role:"listbox"},a,{ref:t,"data-reach-combobox-list":"",id:u}))})),UC=(0,g.forwardRef)((function(e,t){var n=e.as,r=void 0===n?"li":n,i=e.children,o=e.index,a=e.value,l=e.onClick,s=Yw(e,vC),u=(0,g.useContext)(LC),c=u.onSelect,d=u.data.navigationValue,f=u.transition,p=u.isControlledRef,h=Wf((0,g.useRef)(null),null),v=h[0],m=h[1],b=Of((0,g.useMemo)((function(){return{element:v,value:a}}),[a,v]),jC,o),y=ss(t,m),x=d===a,w=ie((function(){c&&c(a),f(SC,{value:a,isControlled:p.current})}),"handleClick");return(0,g.createElement)(FC.Provider,{value:{value:a,index:b}},(0,g.createElement)(r,Jw({"aria-selected":x,role:"option"},s,{"data-reach-combobox-option":"",ref:y,id:String(QC(a)),"data-highlighted":x?"":void 0,tabIndex:-1,onClick:us(l,w)}),i?ts(i)?i({value:a,index:b}):i:(0,g.createElement)(qC,null)))}));function qC(){var e=(0,g.useContext)(FC).value,t=(0,g.useContext)(LC).data.value,n=(0,g.useMemo)((function(){return cC.findAll({searchWords:JC(t||"").split(/\s+/),textToHighlight:e})}),[t,e]);return(0,g.createElement)(g.Fragment,null,n.length?n.map((function(t,n){var r=e.slice(t.start,t.end);return(0,g.createElement)("span",{key:n,"data-reach-combobox-option-text":"","data-user-value":!!t.highlight||void 0,"data-suggested-value":!t.highlight||void 0},r)})):e)}function WC(e,t){Gl((function(){var n;e!==kC&&e!==TC&&e!==SC&&e!==NC||(null==(n=t.current)||n.focus())}),[t,e])}function GC(){var e=(0,g.useContext)(LC),t=e.data.navigationValue,n=e.onSelect,r=e.state,i=e.transition,o=e.autocompletePropRef,a=e.persistSelectionRef,l=e.isControlledRef,s=Pf(jC);return ie((function(e){var u=s.findIndex((function(e){return e.value===t}));function c(){return u===s.length-1?o.current?null:f():s[(u+1)%s.length]}function d(){return 0===u?o.current?null:p():-1===u?p():s[(u-1+s.length)%s.length]}function f(){return s[0]}function p(){return s[s.length-1]}switch(ie(c,"getNextOption"),ie(d,"getPreviousOption"),ie(f,"getFirstOption"),ie(p,"getLastOption"),e.key){case"ArrowDown":if(e.preventDefault(),!s||!s.length)return;if(r===mC)i(kC,{persistSelection:a.current});else{var h=c();i(kC,{value:h?h.value:null})}break;case"ArrowUp":if(e.preventDefault(),!s||0===s.length)return;if(r===mC)i(kC);else{var v=d();i(kC,{value:v?v.value:null})}break;case"Home":case"PageUp":if(e.preventDefault(),!s||0===s.length)return;r===mC?i(kC):i(kC,{value:f().value});break;case"End":case"PageDown":if(e.preventDefault(),!s||0===s.length)return;r===mC?i(kC):i(kC,{value:p().value});break;case"Escape":r!==mC&&i(TC);break;case"Enter":r===bC&&null!==t&&(e.preventDefault(),n&&n(t),i(EC,{isControlled:l.current}))}}),"handleKeyDown")}function KC(){var e=(0,g.useContext)(LC),t=e.state,n=e.transition,r=e.popoverRef,i=e.inputRef,o=e.buttonRef;return ie((function(e){var a=r.current,l=i.current,s=o.current,u=e.relatedTarget;u!==l&&u!==s&&a&&(a.contains(u)?t!==yC&&n(IC):n(_C))}),"handleBlur")}function $C(e,t,n){var r=(0,g.useState)(e.initial),i=r[0],o=r[1],a=(0,g.useReducer)(t,n),l=a[0],s=a[1];return[i,l,ie((function(t,n){void 0===n&&(n={});var r=e.states[i],a=r&&r.on[t];if(a)return s(Jw({type:t,state:i,nextState:i},n)),void o(a)}),"transition")]}function QC(e){var t=0;if(0===e.length)return t;for(var n=0;n0&&p.types.length+p.fields.length>0?Xe("div",{className:"graphiql-doc-explorer-search-divider",children:"Other results"}):null,p.types.map((function(e,t){return Xe(UC,{index:p.within.length+t,value:e,children:Xe(lk,{type:e.type})},"type-".concat(t))})),p.fields.map((function(e,t){return et(UC,{index:p.within.length+p.types.length+t,value:e,children:[Xe(lk,{type:e.type}),".",Xe(sk,{field:e.field,argument:e.argument})]},"field-".concat(t))})),p.within.length+p.types.length+p.fields.length===0?Xe("div",{className:"graphiql-doc-explorer-search-empty",children:"No results found"}):null]})})]}):null}function ok(e){var t=Cw({nonNull:!0,caller:e||ok}).explorerNavStack,n=hw({nonNull:!0,caller:e||ok}).schema,r=t.at(-1);return(0,g.useCallback)((function(e){var t={within:[],types:[],fields:[]};if(!n)return t;var i=r.def,o=n.getTypeMap(),a=Object.keys(o);i&&(a=a.filter((function(e){return e!==i.name}))).unshift(i.name);var l,s=(0,p.Z)(a);try{var u=function(){var n=l.value;if(t.within.length+t.types.length+t.fields.length>=100)return"break";var r=o[n];if(i!==r&&ak(n,e)&&t.types.push({type:r}),!(0,I.lp)(r)&&!(0,I.oT)(r)&&!(0,I.hL)(r))return"continue";var a=r.getFields(),s=function(n){var o,l=a[n],s=void 0;if(!ak(n,e)){if(!("args"in l))return"continue";if(0===(s=l.args.filter((function(t){return ak(t.name,e)}))).length)return"continue"}(o=t[i===r?"within":"fields"]).push.apply(o,(0,f.Z)(s?s.map((function(e){return{type:r,field:l,argument:e}})):[{type:r,field:l}]))};for(var u in a)s(u)};for(s.s();!(l=s.n()).done;){var c=u();if("break"===c)break}}catch(TS){s.e(TS)}finally{s.f()}return t}),[r.def,n])}function ak(e,t){try{var n=t.replaceAll(/[^_0-9A-Za-z]/g,(function(e){return"\\"+e}));return-1!==e.search(new RegExp(n,"i"))}catch(r){return e.toLowerCase().includes(t.toLowerCase())}}function lk(e){return Xe("span",{className:"graphiql-doc-explorer-search-type",children:e.type.name})}function sk(e){return et(tt,{children:[Xe("span",{className:"graphiql-doc-explorer-search-field",children:e.field.name}),e.argument?et(tt,{children:["(",Xe("span",{className:"graphiql-doc-explorer-search-argument",children:e.argument.name}),":"," ",Sw(e.argument.type,(function(e){return Xe(lk,{type:e})})),")"]}):null]})}ie(ik,"Search"),rk(ik,"Search"),ie(ok,"useSearchResults"),rk(ok,"useSearchResults"),ie(ak,"isMatch"),rk(ak,"isMatch"),ie(lk,"Type"),rk(lk,"Type"),ie(sk,"Field$1"),rk(sk,"Field");var uk=Object.defineProperty,ck=ie((function(e,t){return uk(e,"name",{value:t,configurable:!0})}),"__name$l");function dk(e){var t=Cw({nonNull:!0}).push;return Xe("a",{className:"graphiql-doc-explorer-field-name",onClick:function(n){n.preventDefault(),t({name:e.field.name,def:e.field})},href:"#",children:e.field.name})}ie(dk,"FieldLink"),ck(dk,"FieldLink");var fk=Object.defineProperty,pk=ie((function(e,t){return fk(e,"name",{value:t,configurable:!0})}),"__name$k");function hk(e){return(0,I.Zs)(e.type)?et(tt,{children:[e.type.description?Xe(jy,{type:"description",children:e.type.description}):null,Xe(vk,{type:e.type}),Xe(mk,{type:e.type}),Xe(bk,{type:e.type}),Xe(xk,{type:e.type})]}):null}function vk(e){var t=e.type;return(0,I.lp)(t)&&t.getInterfaces().length>0?Xe(zw,{title:"Implements",children:t.getInterfaces().map((function(e){return Xe("div",{children:Xe(Iw,{type:e})},e.name)}))}):null}function mk(e){var t=e.type,n=(0,g.useState)(!1),r=(0,s.Z)(n,2),i=r[0],o=r[1];if(!(0,I.lp)(t)&&!(0,I.oT)(t)&&!(0,I.hL)(t))return null;var a,l=t.getFields(),u=[],c=[],d=(0,p.Z)(Object.keys(l).map((function(e){return l[e]})));try{for(d.s();!(a=d.n()).done;){var f=a.value;f.deprecationReason?c.push(f):u.push(f)}}catch(TS){d.e(TS)}finally{d.f()}return et(tt,{children:[u.length>0?Xe(zw,{title:"Fields",children:u.map((function(e){return Xe(gk,{field:e},e.name)}))}):null,c.length>0?i||0===u.length?Xe(zw,{title:"Deprecated Fields",children:c.map((function(e){return Xe(gk,{field:e},e.name)}))}):Xe(Ul,{type:"button",onClick:function(){o(!0)},children:"Show Deprecated Fields"}):null]})}function gk(e){var t=e.field,n="args"in t?t.args.filter((function(e){return!e.deprecationReason})):[];return et("div",{className:"graphiql-doc-explorer-item",children:[et("div",{children:[Xe(dk,{field:t}),n.length>0?et(tt,{children:["(",Xe("span",{children:n.map((function(e){return 1===n.length?Xe(Ow,{arg:e,inline:!0},e.name):Xe("div",{className:"graphiql-doc-explorer-argument-multiple",children:Xe(Ow,{arg:e,inline:!0})},e.name)}))}),")"]}):null,": ",Xe(Iw,{type:t.type}),Xe(uw,{field:t})]}),t.description?Xe(jy,{type:"description",onlyShowFirstChild:!0,children:t.description}):null,Xe(Dw,{children:t.deprecationReason})]})}function bk(e){var t=e.type,n=(0,g.useState)(!1),r=(0,s.Z)(n,2),i=r[0],o=r[1];if(!(0,I.EM)(t))return null;var a,l=[],u=[],c=(0,p.Z)(t.getValues());try{for(c.s();!(a=c.n()).done;){var d=a.value;d.deprecationReason?u.push(d):l.push(d)}}catch(TS){c.e(TS)}finally{c.f()}return et(tt,{children:[l.length>0?Xe(zw,{title:"Enum Values",children:l.map((function(e){return Xe(yk,{value:e},e.name)}))}):null,u.length>0?i||0===l.length?Xe(zw,{title:"Deprecated Enum Values",children:u.map((function(e){return Xe(yk,{value:e},e.name)}))}):Xe(Ul,{type:"button",onClick:function(){o(!0)},children:"Show Deprecated Values"}):null]})}function yk(e){var t=e.value;return et("div",{className:"graphiql-doc-explorer-item",children:[Xe("div",{className:"graphiql-doc-explorer-enum-value",children:t.name}),t.description?Xe(jy,{type:"description",children:t.description}):null,t.deprecationReason?Xe(jy,{type:"deprecation",children:t.deprecationReason}):null]})}function xk(e){var t=e.type,n=hw({nonNull:!0}).schema;return n&&(0,I.m0)(t)?Xe(zw,{title:(0,I.oT)(t)?"Implementations":"Possible Types",children:n.getPossibleTypes(t).map((function(e){return Xe("div",{children:Xe(Iw,{type:e})},e.name)}))}):null}ie(hk,"TypeDocumentation"),pk(hk,"TypeDocumentation"),ie(vk,"ImplementsInterfaces"),pk(vk,"ImplementsInterfaces"),ie(mk,"Fields"),pk(mk,"Fields"),ie(gk,"Field"),pk(gk,"Field"),ie(bk,"EnumValues"),pk(bk,"EnumValues"),ie(yk,"EnumValue"),pk(yk,"EnumValue"),ie(xk,"PossibleTypes"),pk(xk,"PossibleTypes");var wk=Object.defineProperty,Ck=ie((function(e,t){return wk(e,"name",{value:t,configurable:!0})}),"__name$j");function kk(){var e,t=hw({nonNull:!0,caller:kk}),n=t.fetchError,r=t.isFetching,i=t.schema,o=t.validationErrors,a=Cw({nonNull:!0,caller:kk}),l=a.explorerNavStack,s=a.pop,u=l.at(-1),c=null;return n?c=Xe("div",{className:"graphiql-doc-explorer-error",children:"Error fetching schema"}):o.length>0?c=et("div",{className:"graphiql-doc-explorer-error",children:["Schema is invalid: ",o[0].message]}):r?c=Xe(Ly,{}):i?1===l.length?c=Xe($w,{schema:i}):(0,I.P9)(u.def)?c=Xe(hk,{type:u.def}):u.def&&(c=Xe(Uw,{field:u.def})):c=Xe("div",{className:"graphiql-doc-explorer-error",children:"No GraphQL schema available"}),l.length>1&&(e=l.at(-2).name),et("section",{className:"graphiql-doc-explorer","aria-label":"Documentation Explorer",children:[et("div",{className:"graphiql-doc-explorer-header",children:[et("div",{className:"graphiql-doc-explorer-header-content",children:[e&&et("a",{href:"#",className:"graphiql-doc-explorer-back",onClick:function(e){e.preventDefault(),s()},"aria-label":"Go back to ".concat(e),children:[Xe(hl,{}),e]}),Xe("div",{className:"graphiql-doc-explorer-title",children:u.name})]}),Xe("div",{className:"graphiql-doc-explorer-search",children:Xe(ik,{},u.name)})]}),Xe("div",{className:"graphiql-doc-explorer-content",children:c})]})}ie(kk,"DocExplorer"),Ck(kk,"DocExplorer");var Ek=Object.defineProperty,Sk=ie((function(e,t){return Ek(e,"name",{value:t,configurable:!0})}),"__name$i"),Tk={title:"Documentation Explorer",icon:Sk(ie((function(){var e=Nk();return(null==e?void 0:e.visiblePlugin)===Tk?Xe(Cl,{}):Xe(kl,{})}),"Icon"),"Icon"),content:kk},_k={title:"History",icon:Tl,content:jx},Ik=je("PluginContext");function Rk(e){var t=st(),n=Cw(),r=Px(),i=Boolean(n),o=Boolean(r),a=(0,g.useMemo)((function(){var t=[],n={};i&&(t.push(Tk),n[Tk.title]=!0),o&&(t.push(_k),n[_k.title]=!0);var r,a=(0,p.Z)(e.plugins||[]);try{for(a.s();!(r=a.n()).done;){var l=r.value;if("string"!==typeof l.title||!l.title)throw new Error("All GraphiQL plugins must have a unique title");if(n[l.title])throw new Error("All GraphiQL plugins must have a unique title, found two plugins with the title '".concat(l.title,"'"));t.push(l),n[l.title]=!0}}catch(TS){a.e(TS)}finally{a.f()}return t}),[i,o,e.plugins]),l=(0,g.useState)((function(){var n=null==t?void 0:t.get(Ok),r=a.find((function(e){return e.title===n}));return r||(n&&(null==t||t.set(Ok,"")),e.visiblePlugin&&a.find((function(t){return("string"===typeof e.visiblePlugin?t.title:t)===e.visiblePlugin}))||null)})),u=(0,s.Z)(l,2),c=u[0],d=u[1],f=e.onTogglePluginVisibility,h=e.children,v=(0,g.useCallback)((function(e){var t=e&&a.find((function(t){return("string"===typeof e?t.title:t)===e}))||null;d((function(e){return t===e?e:(null==f||f(t),t)}))}),[f,a]);(0,g.useEffect)((function(){e.visiblePlugin&&v(e.visiblePlugin)}),[a,e.visiblePlugin,v]);var m=(0,g.useMemo)((function(){return{plugins:a,setVisiblePlugin:v,visiblePlugin:c}}),[a,v,c]);return Xe(Ik.Provider,{value:m,children:h})}ie(Rk,"PluginContextProvider"),Sk(Rk,"PluginContextProvider");var Nk=Le(Ik),Ok="visiblePlugin",Mk=Object.defineProperty,Pk=ie((function(e,t){return Mk(e,"name",{value:t,configurable:!0})}),"__name$h");function Dk(e,t,n,r,i,o){function a(e){if(n&&r&&i&&e.currentTarget instanceof HTMLElement){var t=e.currentTarget.innerText,a=n.getType(t);a&&(i.setVisiblePlugin(Tk),r.push({name:a.name,def:a}),null==o||o(a))}}Jx([],{useCommonAddons:!1}).then((function(e){var n,r,i,o,l,s,u,c,d;e.on(t,"select",(function(e,t){if(!n){var f=t.parentNode;(n=document.createElement("div")).className="CodeMirror-hint-information",f.appendChild(n);var p=document.createElement("header");p.className="CodeMirror-hint-information-header",n.appendChild(p),(r=document.createElement("span")).className="CodeMirror-hint-information-field-name",p.appendChild(r),(i=document.createElement("span")).className="CodeMirror-hint-information-type-name-pill",p.appendChild(i),o=document.createElement("span"),i.appendChild(o),(l=document.createElement("a")).className="CodeMirror-hint-information-type-name",l.href="javascript:void 0",l.addEventListener("click",a),i.appendChild(l),s=document.createElement("span"),i.appendChild(s),(u=document.createElement("div")).className="CodeMirror-hint-information-description",n.appendChild(u),(c=document.createElement("div")).className="CodeMirror-hint-information-deprecation",n.appendChild(c);var h=document.createElement("span");h.className="CodeMirror-hint-information-deprecation-label",h.innerText="Deprecated",c.appendChild(h),(d=document.createElement("div")).className="CodeMirror-hint-information-deprecation-reason",c.appendChild(d);var v,m=parseInt(window.getComputedStyle(n).paddingBottom.replace(/px$/,""),10)||0,g=parseInt(window.getComputedStyle(n).maxHeight.replace(/px$/,""),10)||0,b=Pk((function(){n&&(n.style.paddingTop=f.scrollTop+m+"px",n.style.maxHeight=f.scrollTop+g+"px")}),"handleScroll");f.addEventListener("scroll",b),f.addEventListener("DOMNodeRemoved",v=Pk((function(e){e.target===f&&(f.removeEventListener("scroll",b),f.removeEventListener("DOMNodeRemoved",v),n&&n.removeEventListener("click",a),n=null,r=null,i=null,o=null,l=null,s=null,u=null,c=null,d=null,v=null)}),"onRemoveFn"))}if(r&&(r.innerText=e.text),i&&o&&l&&s)if(e.type){i.style.display="inline";var y=Pk((function(e){(0,I.zM)(e)?(s.innerText="!"+s.innerText,y(e.ofType)):(0,I.HG)(e)?(o.innerText+="[",s.innerText="]"+s.innerText,y(e.ofType)):l.innerText=e.name}),"renderType");o.innerText="",s.innerText="",y(e.type)}else o.innerText="",l.innerText="",s.innerText="",i.style.display="none";u&&(e.description?(u.style.display="block",u.innerHTML=Zy.render(e.description)):(u.style.display="none",u.innerHTML="")),c&&d&&(e.deprecationReason?(c.style.display="block",d.innerHTML=Zy.render(e.deprecationReason)):(c.style.display="none",d.innerHTML=""))}))})),ie(a,"onClickHintInformation"),Pk(a,"onClickHintInformation")}ie(Dk,"onHasCompletion"),Pk(Dk,"onHasCompletion");var Ak=Object.defineProperty,Zk=ie((function(e,t){return Ak(e,"name",{value:t,configurable:!0})}),"__name$g");function jk(e,t){(0,g.useEffect)((function(){e&&"string"===typeof t&&t!==e.getValue()&&e.setValue(t)}),[e,t])}function Lk(e,t,n){(0,g.useEffect)((function(){e&&e.setOption(t,n)}),[e,t,n])}function Fk(e,t,n,r,i){var o=LE({nonNull:!0,caller:i}).updateActiveTabValues,a=st();(0,g.useEffect)((function(){if(e){var i=tk(500,(function(e){a&&null!==n&&a.set(n,e)})),l=tk(100,(function(e){o((0,u.Z)({},r,e))})),s=Zk((function(e,n){if(n){var r=e.getValue();i(r),l(r),null==t||t(r)}}),"handleChange");return e.on("change",s),function(){return e.off("change",s)}}}),[t,e,a,n,r,o])}function zk(e,t,n){var r=hw({nonNull:!0,caller:n}).schema,i=Cw(),o=Nk();(0,g.useEffect)((function(){if(e){var n=Zk((function(e,n){Dk(0,n,r,i,o,(function(e){null==t||t({kind:"Type",type:e,schema:r||void 0})}))}),"handleCompletion");return e.on("hasCompletion",n),function(){return e.off("hasCompletion",n)}}}),[t,e,i,o,r])}function Bk(e,t,n){(0,g.useEffect)((function(){if(e){var r,i=(0,p.Z)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;e.removeKeyMap(o)}}catch(TS){i.e(TS)}finally{i.f()}if(n){var a,l={},s=(0,p.Z)(t);try{for(s.s();!(a=s.n()).done;){l[a.value]=function(){return n()}}}catch(TS){s.e(TS)}finally{s.f()}e.addKeyMap(l)}}}),[e,t,n])}function Vk(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.caller,n=e.onCopyQuery,r=LE({nonNull:!0,caller:t||Vk}),i=r.queryEditor;return(0,g.useCallback)((function(){if(i){var e=i.getValue();ow(e),null==n||n(e)}}),[i,n])}function Hk(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.caller,n=LE({nonNull:!0,caller:t||Hk}),r=n.queryEditor,i=hw({nonNull:!0,caller:Hk}),o=i.schema;return(0,g.useCallback)((function(){var e=null==r?void 0:r.documentAST,t=null==r?void 0:r.getValue();e&&t&&r.setValue((0,V.print)(Ie(e,o)))}),[r,o])}function Uk(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.caller,n=LE({nonNull:!0,caller:t||Uk}),r=n.queryEditor,i=n.headerEditor,o=n.variableEditor;return(0,g.useCallback)((function(){if(o){var e=o.getValue();try{var t=JSON.stringify(JSON.parse(e),null,2);t!==e&&o.setValue(t)}catch(u){}}if(i){var n=i.getValue();try{var a=JSON.stringify(JSON.parse(n),null,2);a!==n&&i.setValue(a)}catch(c){}}if(r){var l=r.getValue(),s=(0,V.print)((0,k.Qc)(l));s!==l&&r.setValue(s)}}),[r,o,i])}function qk(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.getDefaultFieldNames,n=e.caller,r=hw({nonNull:!0,caller:n||qk}),i=r.schema,o=LE({nonNull:!0,caller:n||qk}),a=o.queryEditor;return(0,g.useCallback)((function(){if(a){var e=a.getValue(),n=xe(i,e,t),r=n.insertions,o=n.result;return r&&r.length>0&&a.operation((function(){var e=a.getCursor(),t=a.indexFromPos(e);a.setValue(o||"");var n=0,i=r.map((function(e){var t=e.index,r=e.string;return a.markText(a.posFromIndex(t+n),a.posFromIndex(t+(n+=r.length)),{className:"auto-inserted-leaf",clearOnEnter:!0,title:"Automatically added leaf fields"})}));setTimeout((function(){return i.forEach((function(e){return e.clear()}))}),7e3);var l=t;r.forEach((function(e){var n=e.index,r=e.string;n0&&void 0!==arguments[0]?arguments[0]:{},t=e.editorTheme,r=void 0===t?Kx:t,i=e.keyMap,o=void 0===i?$x:i,a=e.onEdit,l=e.readOnly,s=void 0!==l&&l,u=arguments.length>1?arguments[1]:void 0,c=LE({nonNull:!0,caller:u||Kk}),d=c.initialHeaders,f=c.headerEditor,p=c.setHeaderEditor,h=c.shouldPersistHeaders,v=Ux(),m=Hk({caller:u||Kk}),b=Uk({caller:u||Kk}),y=(0,g.useRef)(null);return(0,g.useEffect)((function(){var e=!0;return Jx([Promise.all([n.e(461),n.e(243)]).then(n.bind(n,1243)).then((function(e){return e.j}))]).then((function(t){if(e){var n=y.current;if(n){var i=t(n,{value:d,lineNumbers:!0,tabSize:2,mode:{name:"javascript",json:!0},theme:r,autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,readOnly:!!s&&"nocursor",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:Yx});i.addKeyMap({"Cmd-Space":function(){i.showHint({completeSingle:!1,container:n})},"Ctrl-Space":function(){i.showHint({completeSingle:!1,container:n})},"Alt-Space":function(){i.showHint({completeSingle:!1,container:n})},"Shift-Space":function(){i.showHint({completeSingle:!1,container:n})}}),i.on("keyup",(function(e,t){var n=t.keyCode;(n>=65&&n<=90||!t.shiftKey&&n>=48&&n<=57||t.shiftKey&&189===n||t.shiftKey&&222===n)&&e.execCommand("autocomplete")})),p(i)}}})),function(){e=!1}}),[r,d,s,p]),Lk(f,"keyMap",o),Fk(f,a,h?$k:null,"headers",Kk),Bk(f,["Cmd-Enter","Ctrl-Enter"],null==v?void 0:v.run),Bk(f,["Shift-Ctrl-P"],b),Bk(f,["Shift-Ctrl-M"],m),y}ie(Kk,"useHeaderEditor"),Gk(Kk,"useHeaderEditor");var $k="headers",Qk=Object.defineProperty,Yk=ie((function(e,t){return Qk(e,"name",{value:t,configurable:!0})}),"__name$e"),Jk=Array.from({length:11},(function(e,t){return String.fromCharCode(8192+t)})).concat(["\u2028","\u2029","\u202f","\xa0"]),Xk=new RegExp("["+Jk.join("")+"]","g");function eE(e){return e.replace(Xk," ")}ie(eE,"normalizeWhitespace"),Yk(eE,"normalizeWhitespace");var tE=Object.defineProperty,nE=ie((function(e,t){return tE(e,"name",{value:t,configurable:!0})}),"__name$d");function rE(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.editorTheme,r=void 0===t?Kx:t,i=e.keyMap,o=void 0===i?$x:i,a=e.onClickReference,l=e.onCopyQuery,s=e.onEdit,u=e.readOnly,c=void 0!==u&&u,d=arguments.length>1?arguments[1]:void 0,f=hw({nonNull:!0,caller:d||rE}),h=f.schema,v=LE({nonNull:!0,caller:d||rE}),m=v.externalFragments,b=v.initialQuery,y=v.queryEditor,x=v.setOperationName,w=v.setQueryEditor,C=v.validationRules,k=v.variableEditor,E=v.updateActiveTabValues,S=Ux(),T=st(),_=Cw(),I=Nk(),R=Vk({caller:d||rE,onCopyQuery:l}),N=Hk({caller:d||rE}),O=Uk({caller:d||rE}),M=(0,g.useRef)(null),P=(0,g.useRef)(),D=(0,g.useRef)((function(){}));(0,g.useEffect)((function(){D.current=function(e){if(_&&I){switch(I.setVisiblePlugin(Tk),e.kind){case"Type":_.push({name:e.type.name,def:e.type});break;case"Field":_.push({name:e.field.name,def:e.field});break;case"Argument":e.field&&_.push({name:e.field.name,def:e.field});break;case"EnumValue":e.type&&_.push({name:e.type.name,def:e.type})}null==a||a(e)}}}),[_,a,I]),(0,g.useEffect)((function(){var e=!0;return Jx([Promise.all([n.e(461),n.e(628)]).then(n.bind(n,8628)).then((function(e){return e.c})),Promise.all([n.e(461),n.e(554)]).then(n.bind(n,2554)).then((function(e){return e.s})),Promise.all([n.e(461),n.e(966)]).then(n.bind(n,5966)),Promise.all([n.e(461),n.e(936)]).then(n.bind(n,6936)),Promise.all([n.e(461),n.e(142)]).then(n.bind(n,8142)),Promise.all([n.e(461),n.e(950)]).then(n.bind(n,950)),Promise.all([n.e(461),n.e(299)]).then(n.bind(n,3299))]).then((function(t){if(e){P.current=t;var n=M.current;if(n){var i=t(n,{value:b,lineNumbers:!0,tabSize:2,foldGutter:!0,mode:"graphql",theme:r,autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,readOnly:!!c&&"nocursor",lint:{schema:void 0,validationRules:null,externalFragments:void 0},hintOptions:{schema:void 0,closeOnUnfocus:!1,completeSingle:!1,container:n,externalFragments:void 0},info:{schema:void 0,renderDescription:function(e){return Zy.render(e)},onClick:function(e){D.current(e)}},jump:{schema:void 0,onClick:function(e){D.current(e)}},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:re(ne({},Yx),{"Cmd-S":function(){},"Ctrl-S":function(){}})});i.addKeyMap({"Cmd-Space":function(){i.showHint({completeSingle:!0,container:n})},"Ctrl-Space":function(){i.showHint({completeSingle:!0,container:n})},"Alt-Space":function(){i.showHint({completeSingle:!0,container:n})},"Shift-Space":function(){i.showHint({completeSingle:!0,container:n})},"Shift-Alt-Space":function(){i.showHint({completeSingle:!0,container:n})}}),i.on("keyup",(function(e,t){lE.test(t.key)&&e.execCommand("autocomplete")}));var o=!1;i.on("startCompletion",(function(){o=!0})),i.on("endCompletion",(function(){o=!1})),i.on("keydown",(function(e,t){"Escape"===t.key&&o&&t.stopPropagation()})),i.on("beforeChange",(function(e,t){var n;if("paste"===t.origin){var r=t.text.map(eE);null==(n=t.update)||n.call(t,t.from,t.to,r)}})),i.documentAST=null,i.operationName=null,i.operations=null,i.variableToType=null,w(i)}}})),function(){e=!1}}),[r,b,c,w]),Lk(y,"keyMap",o),(0,g.useEffect)((function(){if(y){ie(t,"getAndUpdateOperationFacts"),nE(t,"getAndUpdateOperationFacts");var e=tk(100,(function(e){var n,r=e.getValue();null==T||T.set(sE,r);var i=e.operationName,o=t(e);void 0!==(null==o?void 0:o.operationName)&&(null==T||T.set(uE,o.operationName)),null==s||s(r,null==o?void 0:o.documentAST),(null==o?void 0:o.operationName)&&i!==o.operationName&&x(o.operationName),E({query:r,operationName:null!=(n=null==o?void 0:o.operationName)?n:null})}));return t(y),y.on("change",e),function(){return y.off("change",e)}}function t(e){var t,n,r,i,o,a=va(h,e.getValue()),l=Re(null!=(t=e.operations)?t:void 0,null!=(n=e.operationName)?n:void 0,null==a?void 0:a.operations);return e.documentAST=null!=(r=null==a?void 0:a.documentAST)?r:null,e.operationName=null!=l?l:null,e.operations=null!=(i=null==a?void 0:a.operations)?i:null,k&&(k.state.lint.linterOptions.variableToType=null==a?void 0:a.variableToType,k.options.lint.variableToType=null==a?void 0:a.variableToType,k.options.hintOptions.variableToType=null==a?void 0:a.variableToType,null==(o=P.current)||o.signal(k,"change",k)),a?re(ne({},a),{operationName:l}):null}}),[s,y,h,x,T,k,E]),iE(y,null!=h?h:null,P),oE(y,null!=C?C:null,P),aE(y,m,P),zk(y,a||null,rE);var A=null==S?void 0:S.run,Z=(0,g.useCallback)((function(){var e;if(A&&y&&y.operations&&y.hasFocus()){var t,n,r=y.indexFromPos(y.getCursor()),i=(0,p.Z)(y.operations);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.loc&&o.loc.start<=r&&o.loc.end>=r&&(t=null==(e=o.name)?void 0:e.value)}}catch(TS){i.e(TS)}finally{i.f()}t&&t!==y.operationName&&x(t),A()}else null==A||A()}),[y,A,x]);return Bk(y,["Cmd-Enter","Ctrl-Enter"],Z),Bk(y,["Shift-Ctrl-C"],R),Bk(y,["Shift-Ctrl-P","Shift-Ctrl-F"],O),Bk(y,["Shift-Ctrl-M"],N),M}function iE(e,t,n){(0,g.useEffect)((function(){if(e){var r=e.options.lint.schema!==t;e.state.lint.linterOptions.schema=t,e.options.lint.schema=t,e.options.hintOptions.schema=t,e.options.info.schema=t,e.options.jump.schema=t,r&&n.current&&n.current.signal(e,"change",e)}}),[e,t,n])}function oE(e,t,n){(0,g.useEffect)((function(){if(e){var r=e.options.lint.validationRules!==t;e.state.lint.linterOptions.validationRules=t,e.options.lint.validationRules=t,r&&n.current&&n.current.signal(e,"change",e)}}),[e,t,n])}function aE(e,t,n){var r=(0,g.useMemo)((function(){return(0,f.Z)(t.values())}),[t]);(0,g.useEffect)((function(){if(e){var t=e.options.lint.externalFragments!==r;e.state.lint.linterOptions.externalFragments=r,e.options.lint.externalFragments=r,e.options.hintOptions.externalFragments=r,t&&n.current&&n.current.signal(e,"change",e)}}),[e,r,n])}ie(rE,"useQueryEditor"),nE(rE,"useQueryEditor"),ie(iE,"useSynchronizeSchema"),nE(iE,"useSynchronizeSchema"),ie(oE,"useSynchronizeValidationRules"),nE(oE,"useSynchronizeValidationRules"),ie(aE,"useSynchronizeExternalFragments"),nE(aE,"useSynchronizeExternalFragments");var lE=/^[a-zA-Z0-9_@(]$/,sE="query",uE="operationName",cE=Object.defineProperty,dE=ie((function(e,t){return cE(e,"name",{value:t,configurable:!0})}),"__name$c");function fE(e){var t=e.defaultQuery,n=e.defaultHeaders,r=e.headers,i=e.defaultTabs,o=e.query,a=e.variables,l=e.storage,s=null==l?void 0:l.get(RE);try{if(!s)throw new Error("Storage for tabs is empty");var u=JSON.parse(s);if(pE(u)){for(var c=SE({query:o,variables:a,headers:r}),d=-1,f=0;f=0)u.activeTabIndex=d;else{var h=o?TE(o):null;u.tabs.push({id:EE(),hash:c,title:h||IE,query:o,variables:a,headers:r,operationName:h,response:null}),u.activeTabIndex=u.tabs.length-1}return u}throw new Error("Storage for tabs is invalid")}catch(v){return{activeTabIndex:0,tabs:(i||[{query:null!=o?o:t,variables:a,headers:null!=r?r:n}]).map(CE)}}}function pE(e){return e&&"object"===typeof e&&!Array.isArray(e)&&vE(e,"activeTabIndex")&&"tabs"in e&&Array.isArray(e.tabs)&&e.tabs.every(hE)}function hE(e){return e&&"object"===typeof e&&!Array.isArray(e)&&mE(e,"id")&&mE(e,"title")&&gE(e,"query")&&gE(e,"variables")&&gE(e,"headers")&&gE(e,"operationName")&&gE(e,"response")}function vE(e,t){return t in e&&"number"===typeof e[t]}function mE(e,t){return t in e&&"string"===typeof e[t]}function gE(e,t){return t in e&&("string"===typeof e[t]||null===e[t])}function bE(e){var t=e.queryEditor,n=e.variableEditor,r=e.headerEditor,i=e.responseEditor;return(0,g.useCallback)((function(e){var o,a,l,s,u,c=null!=(o=null==t?void 0:t.getValue())?o:null,d=null!=(a=null==n?void 0:n.getValue())?a:null,f=null!=(l=null==r?void 0:r.getValue())?l:null,p=null!=(s=null==t?void 0:t.operationName)?s:null;return kE(e,{query:c,variables:d,headers:f,response:null!=(u=null==i?void 0:i.getValue())?u:null,operationName:p})}),[t,n,r,i])}function yE(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return JSON.stringify(e,(function(e,n){return"hash"===e||"response"===e||!t&&"headers"===e?null:n}))}function xE(e){var t=e.storage,n=e.shouldPersistHeaders,r=(0,g.useMemo)((function(){return tk(500,(function(e){null==t||t.set(RE,e)}))}),[t]);return(0,g.useCallback)((function(e){r(yE(e,n))}),[n,r])}function wE(e){var t=e.queryEditor,n=e.variableEditor,r=e.headerEditor,i=e.responseEditor;return(0,g.useCallback)((function(e){var o=e.query,a=e.variables,l=e.headers,s=e.response;null==t||t.setValue(null!=o?o:""),null==n||n.setValue(null!=a?a:""),null==r||r.setValue(null!=l?l:""),null==i||i.setValue(null!=s?s:"")}),[r,t,i,n])}function CE(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.query,n=void 0===t?null:t,r=e.variables,i=void 0===r?null:r,o=e.headers,a=void 0===o?null:o;return{id:EE(),hash:SE({query:n,variables:i,headers:a}),title:n&&TE(n)||IE,query:n,variables:i,headers:a,operationName:null,response:null}}function kE(e,t){return re(ne({},e),{tabs:e.tabs.map((function(n,r){if(r!==e.activeTabIndex)return n;var i=ne(ne({},n),t);return re(ne({},i),{hash:SE(i),title:i.operationName||(i.query?TE(i.query):void 0)||IE})}))})}function EE(){var e=dE((function(){return Math.floor(65536*(1+Math.random())).toString(16).slice(1)}),"s4");return"".concat(e()).concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e(),"-").concat(e()).concat(e()).concat(e())}function SE(e){var t,n,r;return[null!=(t=e.query)?t:"",null!=(n=e.variables)?n:"",null!=(r=e.headers)?r:""].join("|")}function TE(e){var t,n=/^(?!#).*(query|subscription|mutation)\s+([a-zA-Z0-9_]+)/m.exec(e);return null!=(t=null==n?void 0:n[2])?t:null}function _E(e){var t=null==e?void 0:e.get(RE);if(t){var n=JSON.parse(t);null==e||e.set(RE,JSON.stringify(n,(function(e,t){return"headers"===e?null:t})))}}ie(fE,"getDefaultTabState"),dE(fE,"getDefaultTabState"),ie(pE,"isTabsState"),dE(pE,"isTabsState"),ie(hE,"isTabState"),dE(hE,"isTabState"),ie(vE,"hasNumberKey"),dE(vE,"hasNumberKey"),ie(mE,"hasStringKey"),dE(mE,"hasStringKey"),ie(gE,"hasStringOrNullKey"),dE(gE,"hasStringOrNullKey"),ie(bE,"useSynchronizeActiveTabValues"),dE(bE,"useSynchronizeActiveTabValues"),ie(yE,"serializeTabState"),dE(yE,"serializeTabState"),ie(xE,"useStoreTabs"),dE(xE,"useStoreTabs"),ie(wE,"useSetEditorValues"),dE(wE,"useSetEditorValues"),ie(CE,"createTab"),dE(CE,"createTab"),ie(kE,"setPropertiesInActiveTab"),dE(kE,"setPropertiesInActiveTab"),ie(EE,"guid"),dE(EE,"guid"),ie(SE,"hashFromTabContents"),dE(SE,"hashFromTabContents"),ie(TE,"fuzzyExtractOperationName"),dE(TE,"fuzzyExtractOperationName"),ie(_E,"clearHeadersFromTabs"),dE(_E,"clearHeadersFromTabs");var IE="",RE="tabState",NE=Object.defineProperty,OE=ie((function(e,t){return NE(e,"name",{value:t,configurable:!0})}),"__name$b");function ME(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.editorTheme,r=void 0===t?Kx:t,i=e.keyMap,o=void 0===i?$x:i,a=e.onClickReference,l=e.onEdit,s=e.readOnly,u=void 0!==s&&s,c=arguments.length>1?arguments[1]:void 0,d=LE({nonNull:!0,caller:c||ME}),f=d.initialVariables,p=d.variableEditor,h=d.setVariableEditor,v=Ux(),m=Hk({caller:c||ME}),b=Uk({caller:c||ME}),y=(0,g.useRef)(null),x=(0,g.useRef)();return(0,g.useEffect)((function(){var e=!0;return Jx([Promise.all([n.e(461),n.e(904)]).then(n.bind(n,1904)),Promise.all([n.e(461),n.e(15)]).then(n.bind(n,1015)),Promise.all([n.e(461),n.e(401)]).then(n.bind(n,2401))]).then((function(t){if(e){x.current=t;var n=y.current;if(n){var i=t(n,{value:f,lineNumbers:!0,tabSize:2,mode:"graphql-variables",theme:r,autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,readOnly:!!u&&"nocursor",foldGutter:!0,lint:{variableToType:void 0},hintOptions:{closeOnUnfocus:!1,completeSingle:!1,container:n,variableToType:void 0},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:Yx});i.addKeyMap({"Cmd-Space":function(){i.showHint({completeSingle:!1,container:n})},"Ctrl-Space":function(){i.showHint({completeSingle:!1,container:n})},"Alt-Space":function(){i.showHint({completeSingle:!1,container:n})},"Shift-Space":function(){i.showHint({completeSingle:!1,container:n})}}),i.on("keyup",(function(e,t){var n=t.keyCode;(n>=65&&n<=90||!t.shiftKey&&n>=48&&n<=57||t.shiftKey&&189===n||t.shiftKey&&222===n)&&e.execCommand("autocomplete")})),h(i)}}})),function(){e=!1}}),[r,f,u,h]),Lk(p,"keyMap",o),Fk(p,l,PE,"variables",ME),zk(p,a||null,ME),Bk(p,["Cmd-Enter","Ctrl-Enter"],null==v?void 0:v.run),Bk(p,["Shift-Ctrl-P"],b),Bk(p,["Shift-Ctrl-M"],m),y}ie(ME,"useVariableEditor"),OE(ME,"useVariableEditor");var PE="variables",DE=Object.defineProperty,AE=ie((function(e,t){return DE(e,"name",{value:t,configurable:!0})}),"__name$a"),ZE=je("EditorContext");function jE(e){var t=st(),n=(0,g.useState)(null),r=(0,s.Z)(n,2),i=r[0],o=r[1],a=(0,g.useState)(null),l=(0,s.Z)(a,2),u=l[0],c=l[1],d=(0,g.useState)(null),h=(0,s.Z)(d,2),v=h[0],m=h[1],b=(0,g.useState)(null),y=(0,s.Z)(b,2),x=y[0],w=y[1],C=(0,g.useState)((function(){var n=null!==(null==t?void 0:t.get(FE));return!1!==e.shouldPersistHeaders&&n?"true"===(null==t?void 0:t.get(FE)):Boolean(e.shouldPersistHeaders)})),E=(0,s.Z)(C,2),S=E[0],T=E[1];jk(i,e.headers),jk(u,e.query),jk(v,e.response),jk(x,e.variables);var _=xE({storage:t,shouldPersistHeaders:S}),I=(0,g.useState)((function(){var n,r,i,o,a,l,s,u,c,d=null!=(r=null!=(n=e.query)?n:null==t?void 0:t.get(sE))?r:null,f=null!=(o=null!=(i=e.variables)?i:null==t?void 0:t.get(PE))?o:null,p=null!=(l=null!=(a=e.headers)?a:null==t?void 0:t.get($k))?l:null,h=null!=(s=e.response)?s:"",v=fE({query:d,variables:f,headers:p,defaultTabs:e.defaultTabs||e.initialTabs,defaultQuery:e.defaultQuery||zE,defaultHeaders:e.defaultHeaders,storage:t});return _(v),{query:null!=(u=null!=d?d:0===v.activeTabIndex?v.tabs[0].query:null)?u:"",variables:null!=f?f:"",headers:null!=(c=null!=p?p:e.defaultHeaders)?c:"",response:h,tabState:v}})),R=(0,s.Z)(I,1)[0],N=(0,g.useState)(R.tabState),O=(0,s.Z)(N,2),M=O[0],P=O[1],D=(0,g.useCallback)((function(e){var n;if(e){null==t||t.set($k,null!=(n=null==i?void 0:i.getValue())?n:"");var r=yE(M,!0);null==t||t.set(RE,r)}else null==t||t.set($k,""),_E(t);T(e),null==t||t.set(FE,e.toString())}),[t,M,i]),A=(0,g.useRef)(void 0);(0,g.useEffect)((function(){var t=Boolean(e.shouldPersistHeaders);A.current!==t&&(D(t),A.current=t)}),[e.shouldPersistHeaders,D]);var Z=bE({queryEditor:u,variableEditor:x,headerEditor:i,responseEditor:v}),j=wE({queryEditor:u,variableEditor:x,headerEditor:i,responseEditor:v}),L=e.onTabChange,F=e.defaultHeaders,z=e.children,V=(0,g.useCallback)((function(){P((function(e){var t=Z(e),n={tabs:[].concat((0,f.Z)(t.tabs),[CE({headers:F})]),activeTabIndex:t.tabs.length};return _(n),j(n.tabs[n.activeTabIndex]),null==L||L(n),n}))}),[F,L,j,_,Z]),H=(0,g.useCallback)((function(e){P((function(t){var n=re(ne({},Z(t)),{activeTabIndex:e});return _(n),j(n.tabs[n.activeTabIndex]),null==L||L(n),n}))}),[L,j,_,Z]),U=(0,g.useCallback)((function(e){P((function(t){var n={tabs:t.tabs.filter((function(t,n){return e!==n})),activeTabIndex:Math.max(t.activeTabIndex-1,0)};return _(n),j(n.tabs[n.activeTabIndex]),null==L||L(n),n}))}),[L,j,_]),q=(0,g.useCallback)((function(e){P((function(t){var n=kE(t,e);return _(n),null==L||L(n),n}))}),[L,_]),W=e.onEditOperationName,G=(0,g.useCallback)((function(e){u&&(u.operationName=e,q({operationName:e}),null==W||W(e))}),[W,u,q]),K=(0,g.useMemo)((function(){var t=new Map;if(Array.isArray(e.externalFragments)){var n,r=(0,p.Z)(e.externalFragments);try{for(r.s();!(n=r.n()).done;){var i=n.value;t.set(i.name.value,i)}}catch(TS){r.e(TS)}finally{r.f()}}else if("string"===typeof e.externalFragments)(0,B.Vn)((0,k.Qc)(e.externalFragments,{}),{FragmentDefinition:function(e){t.set(e.name.value,e)}});else if(e.externalFragments)throw new Error("The `externalFragments` prop must either be a string that contains the fragment definitions in SDL or a list of FragmentDefinitionNode objects.");return t}),[e.externalFragments]),$=(0,g.useMemo)((function(){return e.validationRules||[]}),[e.validationRules]),Q=(0,g.useMemo)((function(){return re(ne({},M),{addTab:V,changeTab:H,closeTab:U,updateActiveTabValues:q,headerEditor:i,queryEditor:u,responseEditor:v,variableEditor:x,setHeaderEditor:o,setQueryEditor:c,setResponseEditor:m,setVariableEditor:w,setOperationName:G,initialQuery:R.query,initialVariables:R.variables,initialHeaders:R.headers,initialResponse:R.response,externalFragments:K,validationRules:$,shouldPersistHeaders:S,setShouldPersistHeaders:D})}),[M,V,H,U,q,i,u,v,x,G,R,K,$,S,D]);return Xe(ZE.Provider,{value:Q,children:z})}ie(jE,"EditorContextProvider"),AE(jE,"EditorContextProvider");var LE=Le(ZE),FE="shouldPersistHeaders",zE='# Welcome to GraphiQL\n#\n# GraphiQL is an in-browser tool for writing, validating, and\n# testing GraphQL queries.\n#\n# Type queries into this side of the screen, and you will see intelligent\n# typeaheads aware of the current GraphQL type schema and live syntax and\n# validation errors highlighted within the text.\n#\n# GraphQL queries typically start with a "{" character. Lines that start\n# with a # are ignored.\n#\n# An example GraphQL query might look like:\n#\n# {\n# field(arg: "value") {\n# subField\n# }\n# }\n#\n# Keyboard shortcuts:\n#\n# Prettify query: Shift-Ctrl-P (or press the prettify button)\n#\n# Merge fragments: Shift-Ctrl-M (or press the merge button)\n#\n# Run Query: Ctrl-Enter (or press the play button)\n#\n# Auto Complete: Ctrl-Space (or just start typing)\n#\n\n',BE=Object.defineProperty,VE=ie((function(e,t){return BE(e,"name",{value:t,configurable:!0})}),"__name$9");function HE(e){var t=e,n=t.isHidden,r=oe(t,["isHidden"]),i=LE({nonNull:!0,caller:HE}).headerEditor,o=Kk(r,HE);return(0,g.useEffect)((function(){i&&!n&&i.refresh()}),[i,n]),Xe("div",{className:le("graphiql-editor",n&&"hidden"),ref:o})}ie(HE,"HeaderEditor"),VE(HE,"HeaderEditor");var UE=Object.defineProperty,qE=ie((function(e,t){return UE(e,"name",{value:t,configurable:!0})}),"__name$8");function WE(e){var t,n=(0,g.useState)({width:null,height:null}),r=(0,s.Z)(n,2),i=r[0],o=r[1],a=(0,g.useState)(null),l=(0,s.Z)(a,2),u=l[0],c=l[1],d=(0,g.useRef)(null),f=null==(t=GE(e.token))?void 0:t.href;(0,g.useEffect)((function(){if(d.current)return f?void fetch(f,{method:"HEAD"}).then((function(e){c(e.headers.get("Content-Type"))})).catch((function(){c(null)})):(o({width:null,height:null}),void c(null))}),[f]);var p=null!==i.width&&null!==i.height?et("div",{children:[i.width,"x",i.height,null===u?null:" "+u]}):null;return et("div",{children:[Xe("img",{onLoad:function(){var e,t,n,r;o({width:null!=(t=null==(e=d.current)?void 0:e.naturalWidth)?t:null,height:null!=(r=null==(n=d.current)?void 0:n.naturalHeight)?r:null})},ref:d,src:f}),p]})}function GE(e){if("string"===e.type){var t=e.string.slice(1).slice(0,-1).trim();try{var n=window.location;return new URL(t,n.protocol+"//"+n.host)}catch(r){return}}}function KE(e){return/(bmp|gif|jpeg|jpg|png|svg)$/.test(e.pathname)}ie(WE,"ImagePreview"),qE(WE,"ImagePreview"),WE.shouldRender=qE(ie((function(e){var t=GE(e);return!!t&&KE(t)}),"shouldRender"),"shouldRender"),ie(GE,"tokenToURL"),qE(GE,"tokenToURL"),ie(KE,"isImageURL"),qE(KE,"isImageURL");var $E=Object.defineProperty,QE=ie((function(e,t){return $E(e,"name",{value:t,configurable:!0})}),"__name$7");function YE(e){var t=rE(e,YE);return Xe("div",{className:"graphiql-editor",ref:t})}ie(YE,"QueryEditor"),QE(YE,"QueryEditor");var JE=Object.defineProperty,XE=ie((function(e,t){return JE(e,"name",{value:t,configurable:!0})}),"__name$6");function eS(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.responseTooltip,r=e.editorTheme,i=void 0===r?Kx:r,o=e.keyMap,a=void 0===o?$x:o,l=arguments.length>1?arguments[1]:void 0,s=hw({nonNull:!0,caller:l||eS}),u=s.fetchError,c=s.validationErrors,d=LE({nonNull:!0,caller:l||eS}),f=d.initialResponse,p=d.responseEditor,h=d.setResponseEditor,v=(0,g.useRef)(null),m=(0,g.useRef)(t);return(0,g.useEffect)((function(){m.current=t}),[t]),(0,g.useEffect)((function(){var e=!0;return Jx([Promise.all([n.e(461),n.e(986)]).then(n.bind(n,986)).then((function(e){return e.f})),Promise.all([n.e(461),n.e(474)]).then(n.bind(n,6474)).then((function(e){return e.b})),Promise.all([n.e(461),n.e(301)]).then(n.bind(n,3301)).then((function(e){return e.d})),Promise.all([n.e(461),n.e(554)]).then(n.bind(n,2554)).then((function(e){return e.s})),Promise.all([n.e(461),n.e(822)]).then(n.bind(n,9822)).then((function(e){return e.s})),Promise.all([n.e(461),n.e(491)]).then(n.bind(n,4491)).then((function(e){return e.j})),Promise.all([n.e(461),n.e(492)]).then(n.bind(n,6492)).then((function(e){return e.s})),Promise.all([n.e(461),n.e(964)]).then(n.bind(n,7964)),Promise.all([n.e(461),n.e(925)]).then(n.bind(n,9925))],{useCommonAddons:!1}).then((function(t){if(e){var n=document.createElement("div");t.registerHelper("info","graphql-results",(function(e,t,r,i){var o=[],a=m.current;return a&&o.push(Xe(a,{pos:i,token:e})),WE.shouldRender(e)&&o.push(Xe(WE,{token:e},"image-preview")),o.length?(K.render(o,n),n):(K.unmountComponentAtNode(n),null)}));var r=v.current;if(r){var o=t(r,{value:f,lineWrapping:!0,readOnly:!0,theme:i,mode:"graphql-results",foldGutter:!0,gutters:["CodeMirror-foldgutter"],info:!0,extraKeys:Yx});h(o)}}})),function(){e=!1}}),[i,f,h]),Lk(p,"keyMap",a),(0,g.useEffect)((function(){u&&(null==p||p.setValue(u)),c.length>0&&(null==p||p.setValue(be(c)))}),[p,u,c]),v}ie(eS,"useResponseEditor"),XE(eS,"useResponseEditor");var tS=Object.defineProperty,nS=ie((function(e,t){return tS(e,"name",{value:t,configurable:!0})}),"__name$5");function rS(e){var t=eS(e,rS);return Xe("section",{className:"result-window","aria-label":"Result Window","aria-live":"polite","aria-atomic":"true",ref:t})}ie(rS,"ResponseEditor"),nS(rS,"ResponseEditor");var iS=Object.defineProperty,oS=ie((function(e,t){return iS(e,"name",{value:t,configurable:!0})}),"__name$4");function aS(e){var t=e,n=t.isHidden,r=oe(t,["isHidden"]),i=LE({nonNull:!0,caller:aS}).variableEditor,o=ME(r,aS);return(0,g.useEffect)((function(){i&&!n&&i.refresh()}),[i,n]),Xe("div",{className:le("graphiql-editor",n&&"hidden"),ref:o})}ie(aS,"VariableEditor"),oS(aS,"VariableEditor");var lS=Object.defineProperty,sS=ie((function(e,t){return lS(e,"name",{value:t,configurable:!0})}),"__name$3");function uS(e){var t=e.children,n=e.dangerouslyAssumeSchemaIsValid,r=e.defaultQuery,i=e.defaultHeaders,o=e.defaultTabs,a=e.externalFragments,l=e.fetcher,s=e.getDefaultFieldNames,u=e.headers,c=e.initialTabs,d=e.inputValueDeprecation,f=e.introspectionQueryName,p=e.maxHistoryLength,h=e.onEditOperationName,v=e.onSchemaChange,m=e.onTabChange,g=e.onTogglePluginVisibility,b=e.operationName,y=e.plugins,x=e.query,w=e.response,C=e.schema,k=e.schemaDescription,E=e.shouldPersistHeaders,S=e.storage,T=e.validationRules,_=e.variables,I=e.visiblePlugin;return Xe(ot,{storage:S,children:Xe(Mx,{maxHistoryLength:p,children:Xe(jE,{defaultQuery:r,defaultHeaders:i,defaultTabs:o,externalFragments:a,headers:u,initialTabs:c,onEditOperationName:h,onTabChange:m,query:x,response:w,shouldPersistHeaders:E,validationRules:T,variables:_,children:Xe(pw,{dangerouslyAssumeSchemaIsValid:n,fetcher:l,inputValueDeprecation:d,introspectionQueryName:f,onSchemaChange:v,schema:C,schemaDescription:k,children:Xe(Hx,{getDefaultFieldNames:s,fetcher:l,operationName:b,children:Xe(ww,{children:Xe(Rk,{onTogglePluginVisibility:g,plugins:y,visiblePlugin:I,children:t})})})})})})})}ie(uS,"GraphiQLProvider"),sS(uS,"GraphiQLProvider");var cS=Object.defineProperty,dS=ie((function(e,t){return cS(e,"name",{value:t,configurable:!0})}),"__name$2");function fS(){var e=st(),t=(0,g.useState)((function(){if(!e)return null;var t=e.get(pS);switch(t){case"light":return"light";case"dark":return"dark";default:return"string"===typeof t&&e.set(pS,""),null}})),n=(0,s.Z)(t,2),r=n[0],i=n[1];(0,g.useLayoutEffect)((function(){"undefined"!==typeof window&&(document.body.classList.remove("graphiql-light","graphiql-dark"),r&&document.body.classList.add("graphiql-".concat(r)))}),[r]);var o=(0,g.useCallback)((function(t){null==e||e.set(pS,t||""),i(t)}),[e]);return(0,g.useMemo)((function(){return{theme:r,setTheme:o}}),[r,o])}ie(fS,"useTheme"),dS(fS,"useTheme");var pS="theme",hS=Object.defineProperty,vS=ie((function(e,t){return hS(e,"name",{value:t,configurable:!0})}),"__name$1");function mS(e){var t=e.defaultSizeRelation,n=void 0===t?gS:t,r=e.direction,i=e.initiallyHidden,o=e.onHiddenElementChange,a=e.sizeThresholdFirst,l=void 0===a?100:a,u=e.sizeThresholdSecond,c=void 0===u?100:u,d=e.storageKey,f=st(),p=(0,g.useMemo)((function(){return tk(500,(function(e){f&&d&&f.set(d,e)}))}),[f,d]),h=(0,g.useState)((function(){var e=f&&d?f.get(d):null;return e===bS||"first"===i?"first":e===yS||"second"===i?"second":null})),v=(0,s.Z)(h,2),m=v[0],b=v[1],y=(0,g.useCallback)((function(e){e!==m&&(b(e),null==o||o(e))}),[m,o]),x=(0,g.useRef)(null),w=(0,g.useRef)(null),C=(0,g.useRef)(null),k=(0,g.useRef)("".concat(n));(0,g.useLayoutEffect)((function(){var e=f&&d&&f.get(d)||k.current,t="horizontal"===r?"row":"column";x.current&&(x.current.style.display="flex",x.current.style.flexDirection=t,x.current.style.flex=e===bS||e===yS?k.current:e),C.current&&(C.current.style.display="flex",C.current.style.flexDirection=t,C.current.style.flex="1"),w.current&&(w.current.style.display="flex",w.current.style.flexDirection=t)}),[r,f,d]);var E=(0,g.useCallback)((function(e){var t="first"===e?x.current:C.current;if(t&&(t.style.left="-1000px",t.style.position="absolute",t.style.opacity="0",t.style.height="500px",t.style.width="500px",x.current)){var n=parseFloat(x.current.style.flex);(!Number.isFinite(n)||n<1)&&(x.current.style.flex="1")}}),[]),S=(0,g.useCallback)((function(e){var t="first"===e?x.current:C.current;if(t&&(t.style.width="",t.style.height="",t.style.opacity="",t.style.position="",t.style.left="",x.current&&f&&d)){var n=null==f?void 0:f.get(d);n!==bS&&n!==yS&&(x.current.style.flex=n||k.current)}}),[f,d]);return(0,g.useLayoutEffect)((function(){"first"===m?E("first"):S("first"),"second"===m?E("second"):S("second")}),[m,E,S]),(0,g.useEffect)((function(){if(w.current&&x.current&&C.current){var e=w.current,t=x.current,n=t.parentElement,i="horizontal"===r?"clientX":"clientY",o="horizontal"===r?"left":"top",a="horizontal"===r?"right":"bottom",s="horizontal"===r?"clientWidth":"clientHeight";return ie(u,"handleMouseDown"),vS(u,"handleMouseDown"),e.addEventListener("mousedown",u),ie(d,"reset"),vS(d,"reset"),e.addEventListener("dblclick",d),function(){e.removeEventListener("mousedown",u),e.removeEventListener("dblclick",d)}}function u(r){r.preventDefault();var u=r[i]-e.getBoundingClientRect()[o];function d(r){if(0===r.buttons)return f();var d=r[i]-n.getBoundingClientRect()[o]-u,h=n.getBoundingClientRect()[a]-r[i]+u-e[s];if(d1&&"string"!==typeof a,d=i||o,f="".concat(d?"Stop":"Execute"," query (Ctrl-Enter)"),p={type:"button",className:"graphiql-execute-button",children:Xe(d?zl:Ml,{}),"aria-label":f};return c&&!d?et(Tv,{children:[Xe(vx,{label:f,children:Xe(Tv.Button,ne({},p))}),Xe(Tv.List,{children:u.map((function(e,r){var i=e.name?e.name.value:"");return Xe(Tv.Item,{onSelect:function(){var r,i=null==(r=e.name)?void 0:r.value;t&&i&&i!==t.operationName&&n(i),l()},children:i},"".concat(i,"-").concat(r))}))})]}):Xe(vx,{label:f,children:Xe("button",re(ne({},p),{onClick:function(){d?s():l()}}))})}ie(kS,"ExecuteButton"),CS(kS,"ExecuteButton");var ES=(0,g.forwardRef)((function(e,t){var n=e,r=n.button,i=n.children,o=n.label,a=oe(n,["button","children","label"]),l="".concat(o).concat(a.value?": ".concat(a.value):"");return et(Iv.Input,re(ne({},a),{ref:t,className:le("graphiql-toolbar-listbox",a.className),"aria-label":l,children:[Xe(vx,{label:l,children:Xe(Iv.Button,{children:r})}),Xe(Iv.Popover,{children:i})]}))}));ES.displayName="ToolbarListbox";Pd(ES,{Option:Iv.Option});var SS=(0,g.forwardRef)((function(e,t){var n=e,r=n.button,i=n.children,o=n.label,a=oe(n,["button","children","label"]);return et(Tv,re(ne({},a),{ref:t,children:[Xe(vx,{label:o,children:Xe(Tv.Button,{className:le("graphiql-un-styled graphiql-toolbar-menu",a.className),"aria-label":o,children:r})}),Xe(Tv.List,{children:i})]}))}));SS.displayName="ToolbarMenu";Pd(SS,{Item:Tv.Item})},4069:function(e,t,n){"use strict";var r=n(1941);t.Z=void 0;var i=r(n(1608)),o=n(9343),a=(0,i.default)((0,o.jsx)("path",{d:"m10 17 5-5-5-5v10z"}),"ArrowRight");t.Z=a},4195:function(e,t,n){"use strict";var r=n(1941);t.Z=void 0;var i=r(n(1608)),o=n(9343),a=(0,i.default)((0,o.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");t.Z=a},3670:function(e,t,n){"use strict";var r=n(1941);t.Z=void 0;var i=r(n(1608)),o=n(9343),a=(0,i.default)((0,o.jsx)("path",{d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"}),"Download");t.Z=a},8215:function(e,t,n){"use strict";var r=n(1941);t.Z=void 0;var i=r(n(1608)),o=n(9343),a=(0,i.default)((0,o.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");t.Z=a},1739:function(e,t,n){"use strict";var r=n(1941);t.Z=void 0;var i=r(n(1608)),o=n(9343),a=(0,i.default)((0,o.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"Launch");t.Z=a},1608:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r.createSvgIcon}});var r=n(6190)},396:function(e,t){"use strict";var n,r=Symbol.for("react.element"),i=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen");function g(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case o:case l:case a:case f:case p:return e;default:switch(e=e&&e.$$typeof){case c:case u:case d:case v:case h:case s:return e;default:return t}}case i:return t}}}n=Symbol.for("react.module.reference")},8712:function(e,t,n){"use strict";n(396)},3660:function(e,t,n){"use strict";n.d(t,{Z:function(){return Z}});var r=n(2793),i=n(1048),o=n(1316),a=n(4073),l=n(8046),s=n(4165),u=n(4134),c=n(6222);function d(e,t){var n;return(0,r.Z)({toolbar:(n={minHeight:56},(0,c.Z)(n,e.up("xs"),{"@media (orientation: landscape)":{minHeight:48}}),(0,c.Z)(n,e.up("sm"),{minHeight:64}),n)},t)}var f=n(3566),p={black:"#000",white:"#fff"},h={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},v={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},m={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},g={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},b={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},y={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},x={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},w=["mode","contrastThreshold","tonalOffset"],C={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:p.white,default:p.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},k={text:{primary:p.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:p.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function E(e,t,n,r){var i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=(0,f.$n)(e.main,i):"dark"===t&&(e.dark=(0,f._j)(e.main,o)))}function S(e){var t=e.mode,n=void 0===t?"light":t,l=e.contrastThreshold,s=void 0===l?3:l,u=e.tonalOffset,c=void 0===u?.2:u,d=(0,i.Z)(e,w),S=e.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:b[200],light:b[50],dark:b[400]}:{main:b[700],light:b[400],dark:b[800]}}(n),T=e.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:v[200],light:v[50],dark:v[400]}:{main:v[500],light:v[300],dark:v[700]}}(n),_=e.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:m[500],light:m[300],dark:m[700]}:{main:m[700],light:m[400],dark:m[800]}}(n),I=e.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:y[400],light:y[300],dark:y[700]}:{main:y[700],light:y[500],dark:y[900]}}(n),R=e.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:x[400],light:x[300],dark:x[700]}:{main:x[800],light:x[500],dark:x[900]}}(n),N=e.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:g[400],light:g[300],dark:g[700]}:{main:"#ed6c02",light:g[500],dark:g[900]}}(n);function O(e){return(0,f.mi)(e,k.text.primary)>=s?k.text.primary:C.text.primary}var M=function(e){var t=e.color,n=e.name,i=e.mainShade,a=void 0===i?500:i,l=e.lightShade,s=void 0===l?300:l,u=e.darkShade,d=void 0===u?700:u;if(!(t=(0,r.Z)({},t)).main&&t[a]&&(t.main=t[a]),!t.hasOwnProperty("main"))throw new Error((0,o.Z)(11,n?" (".concat(n,")"):"",a));if("string"!==typeof t.main)throw new Error((0,o.Z)(12,n?" (".concat(n,")"):"",JSON.stringify(t.main)));return E(t,"light",s,c),E(t,"dark",d,c),t.contrastText||(t.contrastText=O(t.main)),t},P={dark:k,light:C};return(0,a.Z)((0,r.Z)({common:(0,r.Z)({},p),mode:n,primary:M({color:S,name:"primary"}),secondary:M({color:T,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:M({color:_,name:"error"}),warning:M({color:N,name:"warning"}),info:M({color:I,name:"info"}),success:M({color:R,name:"success"}),grey:h,contrastThreshold:s,getContrastText:O,augmentColor:M,tonalOffset:c},P[n]),d)}var T=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];var _={textTransform:"uppercase"},I='"Roboto", "Helvetica", "Arial", sans-serif';function R(e,t){var n="function"===typeof t?t(e):t,o=n.fontFamily,l=void 0===o?I:o,s=n.fontSize,u=void 0===s?14:s,c=n.fontWeightLight,d=void 0===c?300:c,f=n.fontWeightRegular,p=void 0===f?400:f,h=n.fontWeightMedium,v=void 0===h?500:h,m=n.fontWeightBold,g=void 0===m?700:m,b=n.htmlFontSize,y=void 0===b?16:b,x=n.allVariants,w=n.pxToRem,C=(0,i.Z)(n,T);var k=u/14,E=w||function(e){return"".concat(e/y*k,"rem")},S=function(e,t,n,i,o){return(0,r.Z)({fontFamily:l,fontWeight:e,fontSize:E(t),lineHeight:n},l===I?{letterSpacing:"".concat((a=i/t,Math.round(1e5*a)/1e5),"em")}:{},o,x);var a},R={h1:S(d,96,1.167,-1.5),h2:S(d,60,1.2,-.5),h3:S(p,48,1.167,0),h4:S(p,34,1.235,.25),h5:S(p,24,1.334,0),h6:S(v,20,1.6,.15),subtitle1:S(p,16,1.75,.15),subtitle2:S(v,14,1.57,.1),body1:S(p,16,1.5,.15),body2:S(p,14,1.43,.15),button:S(v,14,1.75,.4,_),caption:S(p,12,1.66,.4),overline:S(p,12,2.66,1,_)};return(0,a.Z)((0,r.Z)({htmlFontSize:y,pxToRem:E,fontFamily:l,fontSize:u,fontWeightLight:d,fontWeightRegular:p,fontWeightMedium:v,fontWeightBold:g},R),C,{clone:!1})}function N(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var O=["none",N(0,2,1,-1,0,1,1,0,0,1,3,0),N(0,3,1,-2,0,2,2,0,0,1,5,0),N(0,3,3,-2,0,3,4,0,0,1,8,0),N(0,2,4,-1,0,4,5,0,0,1,10,0),N(0,3,5,-1,0,5,8,0,0,1,14,0),N(0,3,5,-1,0,6,10,0,0,1,18,0),N(0,4,5,-2,0,7,10,1,0,2,16,1),N(0,5,5,-3,0,8,10,1,0,3,14,2),N(0,5,6,-3,0,9,12,1,0,3,16,2),N(0,6,6,-3,0,10,14,1,0,4,18,3),N(0,6,7,-4,0,11,15,1,0,4,20,3),N(0,7,8,-4,0,12,17,2,0,5,22,4),N(0,7,8,-4,0,13,19,2,0,5,24,4),N(0,7,9,-4,0,14,21,2,0,5,26,4),N(0,8,9,-5,0,15,22,2,0,6,28,5),N(0,8,10,-5,0,16,24,2,0,6,30,5),N(0,8,11,-5,0,17,26,2,0,6,32,5),N(0,9,11,-5,0,18,28,2,0,7,34,6),N(0,9,12,-6,0,19,29,2,0,7,36,6),N(0,10,13,-6,0,20,31,3,0,8,38,7),N(0,10,13,-6,0,21,33,3,0,8,40,7),N(0,10,14,-6,0,22,35,3,0,8,42,7),N(0,11,14,-7,0,23,36,3,0,9,44,8),N(0,11,15,-7,0,24,38,3,0,9,46,8)],M=n(5356),P={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},D=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mixins,n=void 0===t?{}:t,c=e.palette,f=void 0===c?{}:c,p=e.transitions,h=void 0===p?{}:p,v=e.typography,m=void 0===v?{}:v,g=(0,i.Z)(e,D);if(e.vars)throw new Error((0,o.Z)(18));var b=S(f),y=(0,l.Z)(e),x=(0,a.Z)(y,{mixins:d(y.breakpoints,n),palette:b,shadows:O.slice(),typography:R(b,m),transitions:(0,M.ZP)(h),zIndex:(0,r.Z)({},P)});x=(0,a.Z)(x,g);for(var w=arguments.length,C=new Array(w>1?w-1:0),k=1;k0&&void 0!==arguments[0]?arguments[0]:["all"],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.duration,l=void 0===a?n.standard:a,u=i.easing,c=void 0===u?t.easeInOut:u,d=i.delay,f=void 0===d?0:d;(0,r.Z)(i,o);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof l?l:s(l)," ").concat(c," ").concat("string"===typeof f?f:s(f))})).join(",")}},e,{easing:t,duration:n})}},9764:function(e,t,n){"use strict";var r=(0,n(3660).Z)();t.Z=r},8132:function(e,t,n){"use strict";n.d(t,{Dz:function(){return a},FO:function(){return o}});var r=n(4011),i=n(9764),o=function(e){return(0,r.x9)(e)&&"classes"!==e},a=r.x9,l=(0,r.ZP)({defaultTheme:i.Z,rootShouldForwardProp:o});t.ZP=l},4439:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(6005);var i=n(2321);function o(e){var t=e.props,n=e.name,o=e.defaultTheme,a=function(e){var t=e.theme,n=e.name,i=e.props;return t&&t.components&&t.components[n]&&t.components[n].defaultProps?(0,r.Z)(t.components[n].defaultProps,i):i}({theme:(0,i.Z)(o),name:n,props:t});return a}var a=n(9764);function l(e){return o({props:e.props,name:e.name,defaultTheme:a.Z})}},4112:function(e,t,n){"use strict";var r=n(1460);t.Z=r.Z},2701:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var r=n(2793),i=n(8381),o=n(1048),a=n(5863),l=n(2378),s=n(4112),u=n(4439),c=n(8132),d=n(8995),f=n(4438);function p(e){return(0,f.Z)("MuiSvgIcon",e)}(0,d.Z)("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);var h=n(9343),v=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],m=(0,c.ZP)("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:function(e,t){var n=e.ownerState;return[t.root,"inherit"!==n.color&&t["color".concat((0,s.Z)(n.color))],t["fontSize".concat((0,s.Z)(n.fontSize))]]}})((function(e){var t,n,r,i,o,a,l,s,u,c,d,f,p,h,v,m,g,b=e.theme,y=e.ownerState;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,transition:null==(t=b.transitions)||null==(n=t.create)?void 0:n.call(t,"fill",{duration:null==(r=b.transitions)||null==(i=r.duration)?void 0:i.shorter}),fontSize:{inherit:"inherit",small:(null==(o=b.typography)||null==(a=o.pxToRem)?void 0:a.call(o,20))||"1.25rem",medium:(null==(l=b.typography)||null==(s=l.pxToRem)?void 0:s.call(l,24))||"1.5rem",large:(null==(u=b.typography)||null==(c=u.pxToRem)?void 0:c.call(u,35))||"2.1875rem"}[y.fontSize],color:null!=(d=null==(f=(b.vars||b).palette)||null==(p=f[y.color])?void 0:p.main)?d:{action:null==(h=(b.vars||b).palette)||null==(v=h.action)?void 0:v.active,disabled:null==(m=(b.vars||b).palette)||null==(g=m.action)?void 0:g.disabled,inherit:void 0}[y.color]}})),g=i.forwardRef((function(e,t){var n=(0,u.Z)({props:e,name:"MuiSvgIcon"}),i=n.children,c=n.className,d=n.color,f=void 0===d?"inherit":d,g=n.component,b=void 0===g?"svg":g,y=n.fontSize,x=void 0===y?"medium":y,w=n.htmlColor,C=n.inheritViewBox,k=void 0!==C&&C,E=n.titleAccess,S=n.viewBox,T=void 0===S?"0 0 24 24":S,_=(0,o.Z)(n,v),I=(0,r.Z)({},n,{color:f,component:b,fontSize:x,instanceFontSize:e.fontSize,inheritViewBox:k,viewBox:T}),R={};k||(R.viewBox=T);var N=function(e){var t=e.color,n=e.fontSize,r=e.classes,i={root:["root","inherit"!==t&&"color".concat((0,s.Z)(t)),"fontSize".concat((0,s.Z)(n))]};return(0,l.Z)(i,p,r)}(I);return(0,h.jsxs)(m,(0,r.Z)({as:b,className:(0,a.Z)(N.root,c),focusable:"false",color:w,"aria-hidden":!E||void 0,role:E?"img":void 0,ref:t},R,_,{ownerState:I,children:[i,E?(0,h.jsx)("title",{children:E}):null]}))}));g.muiName="SvgIcon";var b=g;function y(e,t){function n(n,i){return(0,h.jsx)(b,(0,r.Z)({"data-testid":"".concat(t,"Icon"),ref:i},n,{children:e}))}return n.muiName=b.muiName,i.memo(i.forwardRef(n))}},3877:function(e,t,n){"use strict";var r=n(3857);t.Z=r.Z},6190:function(e,t,n){"use strict";n.r(t),n.d(t,{capitalize:function(){return i.Z},createChainedFunction:function(){return o},createSvgIcon:function(){return a.Z},debounce:function(){return l.Z},deprecatedPropType:function(){return s},isMuiElement:function(){return u.Z},ownerDocument:function(){return c.Z},ownerWindow:function(){return d.Z},requirePropFactory:function(){return f},setRef:function(){return p},unstable_ClassNameGenerator:function(){return w},unstable_useEnhancedEffect:function(){return h.Z},unstable_useId:function(){return v.Z},unsupportedProp:function(){return m},useControlled:function(){return g.Z},useEventCallback:function(){return b.Z},useForkRef:function(){return y.Z},useIsFocusVisible:function(){return x.Z}});var r=n(6571),i=n(4112),o=n(1920).Z,a=n(2701),l=n(3877);var s=function(e,t){return function(){return null}},u=n(5992),c=n(7412),d=n(7626);n(1860);var f=function(e,t){return function(){return null}},p=n(9863).Z,h=n(496),v=n(6595);var m=function(e,t,n,r,i){return null},g=n(9393),b=n(1463),y=n(355),x=n(6522),w={configure:function(e){r.Z.configure(e)}}},5992:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(8381);var i=function(e,t){return r.isValidElement(e)&&-1!==t.indexOf(e.type.muiName)}},7412:function(e,t,n){"use strict";var r=n(9890);t.Z=r.Z},7626:function(e,t,n){"use strict";var r=n(4967);t.Z=r.Z},9393:function(e,t,n){"use strict";var r=n(5180);t.Z=r.Z},496:function(e,t,n){"use strict";var r=n(2371);t.Z=r.Z},1463:function(e,t,n){"use strict";var r=n(1711);t.Z=r.Z},355:function(e,t,n){"use strict";var r=n(8444);t.Z=r.Z},6595:function(e,t,n){"use strict";var r=n(347);t.Z=r.Z},6522:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var r,i=n(8381),o=!0,a=!1,l={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(e){e.metaKey||e.altKey||e.ctrlKey||(o=!0)}function u(){o=!1}function c(){"hidden"===this.visibilityState&&a&&(o=!0)}function d(e){var t=e.target;try{return t.matches(":focus-visible")}catch(n){}return o||function(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!l[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}var f=function(){var e=i.useCallback((function(e){var t;null!=e&&((t=e.ownerDocument).addEventListener("keydown",s,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("touchstart",u,!0),t.addEventListener("visibilitychange",c,!0))}),[]),t=i.useRef(!1);return{isFocusVisibleRef:t,onFocus:function(e){return!!d(e)&&(t.current=!0,!0)},onBlur:function(){return!!t.current&&(a=!0,window.clearTimeout(r),r=window.setTimeout((function(){a=!1}),100),t.current=!1,!0)},ref:e}}},131:function(e,t,n){"use strict";n.d(t,{ZP:function(){return x},Co:function(){return w}});var r=n(8381);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t96?f:p},v=function(e,t,n){var r;if(t){var i=t.shouldForwardProp;r=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!==typeof r&&n&&(r=e.__emotion_forwardProp),r},m=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;(0,u.hC)(t,n,r);(0,d.L)((function(){return(0,u.My)(t,n,r)}));return null},g=function e(t,n){var o,a,l=t.__emotion_real===t,d=l&&t.__emotion_base||t;void 0!==n&&(o=n.label,a=n.target);var f=v(t,n,l),p=f||h(d),g=!p("as");return function(){var b=arguments,y=l&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==o&&y.push("label:"+o+";"),null==b[0]||void 0===b[0].raw)y.push.apply(y,b);else{0,y.push(b[0][0]);for(var x=b.length,w=1;w0&&void 0!==arguments[0]?arguments[0]:{},n=null==(e=t.keys)?void 0:e.reduce((function(e,n){return e[t.up(n)]={},e}),{});return n||{}}function l(e,t){return e.reduce((function(e,t){var n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e}),t)}function s(e){var t,n=e.values,r=e.breakpoints,i=e.base||function(e,t){if("object"!==typeof e)return{};var n={},r=Object.keys(t);return Array.isArray(e)?r.forEach((function(t,r){r1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function o(e){if(e.type)return e;if("#"===e.charAt(0))return o(function(e){e=e.slice(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(n))throw new Error((0,r.Z)(9,e));var i,a=e.substring(t+1,e.length-1);if("color"===n){if(i=(a=a.split(" ")).shift(),4===a.length&&"/"===a[3].charAt(0)&&(a[3]=a[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i))throw new Error((0,r.Z)(10,i))}else a=a.split(",");return{type:n,values:a=a.map((function(e){return parseFloat(e)})),colorSpace:i}}function a(e){var t=e.type,n=e.colorSpace,r=e.values;return-1!==t.indexOf("rgb")?r=r.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(r[1]="".concat(r[1],"%"),r[2]="".concat(r[2],"%")),r=-1!==t.indexOf("color")?"".concat(n," ").concat(r.join(" ")):"".concat(r.join(", ")),"".concat(t,"(").concat(r,")")}function l(e){var t="hsl"===(e=o(e)).type||"hsla"===e.type?o(function(e){var t=(e=o(e)).values,n=t[0],r=t[1]/100,i=t[2]/100,l=r*Math.min(i,1-i),s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-l*Math.max(Math.min(t-3,9-t,1),-1)},u="rgb",c=[Math.round(255*s(0)),Math.round(255*s(8)),Math.round(255*s(4))];return"hsla"===e.type&&(u+="a",c.push(t[3])),a({type:u,values:c})}(e)).values:e.values;return t=t.map((function(t){return"color"!==e.type&&(t/=255),t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function s(e,t){var n=l(e),r=l(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function u(e,t){return e=o(e),t=i(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]="/".concat(t):e.values[3]=t,a(e)}function c(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return a(e)}function d(e,t){if(e=o(e),t=i(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(-1!==e.type.indexOf("color"))for(var r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return a(e)}},4011:function(e,t,n){"use strict";n.d(t,{ZP:function(){return E},x9:function(){return C}});var r=n(1303),i=n(678),o=n(916),a=n(4695),l=n(131),s=n(8046),u=n(1460),c=["variant"];function d(e){return 0===e.length}function f(e){var t=e.variant,n=(0,o.Z)(e,c),r=t||"";return Object.keys(n).sort().forEach((function(t){r+="color"===t?d(r)?e[t]:(0,u.Z)(e[t]):"".concat(d(r)?t:(0,u.Z)(t)).concat((0,u.Z)(e[t].toString()))})),r}var p=n(4134),h=["name","slot","skipVariantsResolver","skipSx","overridesResolver"],v=["theme"],m=["theme"];function g(e){return 0===Object.keys(e).length}function b(e){return"string"===typeof e&&e.charCodeAt(0)>96}var y=function(e,t){return t.components&&t.components[e]&&t.components[e].styleOverrides?t.components[e].styleOverrides:null},x=function(e,t){var n=[];t&&t.components&&t.components[e]&&t.components[e].variants&&(n=t.components[e].variants);var r={};return n.forEach((function(e){var t=f(e.props);r[t]=e.style})),r},w=function(e,t,n,r){var i,o,a=e.ownerState,l=void 0===a?{}:a,s=[],u=null==n||null==(i=n.components)||null==(o=i[r])?void 0:o.variants;return u&&u.forEach((function(n){var r=!0;Object.keys(n.props).forEach((function(t){l[t]!==n.props[t]&&e[t]!==n.props[t]&&(r=!1)})),r&&s.push(t[f(n.props)])})),s};function C(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}var k=(0,s.Z)();function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.defaultTheme,n=void 0===t?k:t,s=e.rootShouldForwardProp,u=void 0===s?C:s,c=e.slotShouldForwardProp,d=void 0===c?C:c,f=function(e){var t=g(e.theme)?n:e.theme;return(0,p.Z)((0,a.Z)({},e,{theme:t}))};return f.__mui_systemSx=!0,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,l.Co)(e,(function(e){return e.filter((function(e){return!(null!=e&&e.__mui_systemSx)}))}));var s,c=t.name,p=t.slot,k=t.skipVariantsResolver,E=t.skipSx,S=t.overridesResolver,T=(0,o.Z)(t,h),_=void 0!==k?k:p&&"Root"!==p||!1,I=E||!1;var R=C;"Root"===p?R=u:p?R=d:b(e)&&(R=void 0);var N=(0,l.ZP)(e,(0,a.Z)({shouldForwardProp:R,label:s},T)),O=function(e){for(var t=arguments.length,l=new Array(t>1?t-1:0),s=1;s0){var h=new Array(p).fill("");(d=[].concat((0,r.Z)(e),(0,r.Z)(h))).raw=[].concat((0,r.Z)(e.raw),(0,r.Z)(h))}else"function"===typeof e&&e.__emotion_real!==e&&(d=function(t){var r=t.theme,i=(0,o.Z)(t,m);return e((0,a.Z)({theme:g(r)?n:r},i))});var b=N.apply(void 0,[d].concat((0,r.Z)(u)));return b};return N.withConfig&&(O.withConfig=N.withConfig),O}}},8046:function(e,t,n){"use strict";n.d(t,{Z:function(){return v}});var r=n(4695),i=n(916),o=n(4073),a=n(6222),l=["values","unit","step"];function s(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:900,lg:1200,xl:1536}:t,o=e.unit,s=void 0===o?"px":o,u=e.step,c=void 0===u?5:u,d=(0,i.Z)(e,l),f=function(e){var t=Object.keys(e).map((function(t){return{key:t,val:e[t]}}))||[];return t.sort((function(e,t){return e.val-t.val})),t.reduce((function(e,t){return(0,r.Z)({},e,(0,a.Z)({},t.key,t.val))}),{})}(n),p=Object.keys(f);function h(e){var t="number"===typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(s,")")}function v(e){var t="number"===typeof n[e]?n[e]:e;return"@media (max-width:".concat(t-c/100).concat(s,")")}function m(e,t){var r=p.indexOf(t);return"@media (min-width:".concat("number"===typeof n[e]?n[e]:e).concat(s,") and ")+"(max-width:".concat((-1!==r&&"number"===typeof n[p[r]]?n[p[r]]:t)-c/100).concat(s,")")}return(0,r.Z)({keys:p,values:f,up:h,down:v,between:m,only:function(e){return p.indexOf(e)+10&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=(0,c.hB)({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,a=e.palette,l=void 0===a?{}:a,c=e.spacing,v=e.shape,m=void 0===v?{}:v,g=(0,i.Z)(e,h),b=s(n),y=d(c),x=(0,o.Z)({breakpoints:b,direction:"ltr",components:{},palette:(0,r.Z)({mode:"light"},l),spacing:y,shape:(0,r.Z)({},u,m)},g),w=arguments.length,C=new Array(w>1?w-1:0),k=1;k2){if(!u[e])return[e];e=u[e]}var t=e.split(""),n=(0,r.Z)(t,2),i=n[0],o=n[1],a=l[i],c=s[o]||"";return Array.isArray(c)?c.map((function(e){return a+e})):[a+c]})),d=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],f=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],p=[].concat(d,f);function h(e,t,n,r){var i,a=null!=(i=(0,o.DW)(e,t,!1))?i:n;return"number"===typeof a?function(e){return"string"===typeof e?e:a*e}:Array.isArray(a)?function(e){return"string"===typeof e?e:a[e]}:"function"===typeof a?a:function(){}}function v(e){return h(e,"spacing",8)}function m(e,t){if("string"===typeof t||null==t)return t;var n=e(Math.abs(t));return t>=0?n:"number"===typeof n?-n:"-".concat(n)}function g(e,t,n,r){if(-1===t.indexOf(n))return null;var o=function(e,t){return function(n){return e.reduce((function(e,r){return e[r]=m(t,n),e}),{})}}(c(n),r),a=e[n];return(0,i.k9)(e,a,o)}function b(e,t){var n=v(e.theme);return Object.keys(e).map((function(r){return g(e,t,r,n)})).reduce(a.Z,{})}function y(e){return b(e,d)}function x(e){return b(e,f)}function w(e){return b(e,p)}y.propTypes={},y.filterProps=d,x.propTypes={},x.filterProps=f,w.propTypes={},w.filterProps=p},1489:function(e,t,n){"use strict";n.d(t,{DW:function(){return a},Jq:function(){return l}});var r=n(6222),i=n(1460),o=n(9912);function a(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||"string"!==typeof t)return null;if(e&&e.vars&&n){var r="vars.".concat(t).split(".").reduce((function(e,t){return e&&e[t]?e[t]:null}),e);if(null!=r)return r}return t.split(".").reduce((function(e,t){return e&&null!=e[t]?e[t]:null}),e)}function l(e,t,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;return r="function"===typeof e?e(n):Array.isArray(e)?e[n]||i:a(e,n)||i,t&&(r=t(r,i,e)),r}t.ZP=function(e){var t=e.prop,n=e.cssProperty,s=void 0===n?e.prop:n,u=e.themeKey,c=e.transform,d=function(e){if(null==e[t])return null;var n=e[t],d=a(e.theme,u)||{};return(0,o.k9)(e,n,(function(e){var n=l(d,c,e);return e===n&&"string"===typeof e&&(n=l(d,c,"".concat(t).concat("default"===e?"":(0,i.Z)(e)),e)),!1===s?n:(0,r.Z)({},s,n)}))};return d.propTypes={},d.filterProps=[t],d}},4165:function(e,t,n){"use strict";n.d(t,{Z:function(){return O}});var r=n(9125),i=n(1489),o=n(2460);var a=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:o;return(0,i.Z)(e)}},3501:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(8381);var i=r.createContext(null);function o(){return r.useContext(i)}function a(e){return 0===Object.keys(e).length}var l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=o();return!t||a(t)?e:t}},6571:function(e,t){"use strict";var n=function(e){return e},r=function(){var e=n;return{configure:function(t){e=t},generate:function(t){return e(t)},reset:function(){e=n}}}();t.Z=r},1460:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1316);function i(e){if("string"!==typeof e)throw new Error((0,r.Z)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},2378:function(e,t,n){"use strict";function r(e,t,n){var r={};return Object.keys(e).forEach((function(i){r[i]=e[i].reduce((function(e,r){return r&&(e.push(t(r)),n&&n[r]&&e.push(n[r])),e}),[]).join(" ")})),r}n.d(t,{Z:function(){return r}})},1920:function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a2&&void 0!==arguments[2]?arguments[2]:{clone:!0},l=n.clone?(0,r.Z)({},e):e;return i(e)&&i(t)&&Object.keys(t).forEach((function(r){"__proto__"!==r&&(i(t[r])&&r in e&&i(e[r])?l[r]=a(e[r],t[r],n):n.clone?l[r]=i(t[r])?o(t[r]):t[r]:l[r]=t[r])})),l}},1316:function(e,t,n){"use strict";function r(e){for(var t="https://mui.com/production-error/?code="+e,n=1;n2&&void 0!==arguments[2]?arguments[2]:"Mui",o=i[t];return o?"".concat(n,"-").concat(o):"".concat(r.Z.generate(e),"-").concat(t)}},8995:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(4438);function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui",i={};return t.forEach((function(t){i[t]=(0,r.Z)(e,t,n)})),i}},9890:function(e,t,n){"use strict";function r(e){return e&&e.ownerDocument||document}n.d(t,{Z:function(){return r}})},4967:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(9890);function i(e){return(0,r.Z)(e).defaultView||window}},6005:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1860);function i(e,t){var n=(0,r.Z)({},t);return Object.keys(e).forEach((function(o){if(o.toString().match(/^(components|slots)$/))n[o]=(0,r.Z)({},e[o],n[o]);else if(o.toString().match(/^(componentsProps|slotProps)$/)){var a=e[o]||{},l=t[o];n[o]={},l&&Object.keys(l)?a&&Object.keys(a)?(n[o]=(0,r.Z)({},l),Object.keys(a).forEach((function(e){n[o][e]=i(a[e],l[e])}))):n[o]=l:n[o]=a}else void 0===n[o]&&(n[o]=e[o])})),n}},9863:function(e,t,n){"use strict";function r(e,t){"function"===typeof e?e(t):e&&(e.current=t)}n.d(t,{Z:function(){return r}})},5180:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(678),i=n(8381);function o(e){var t=e.controlled,n=e.default,o=(e.name,e.state,i.useRef(void 0!==t).current),a=i.useState(n),l=(0,r.Z)(a,2),s=l[0],u=l[1];return[o?t:s,i.useCallback((function(e){o||u(e)}),[])]}},2371:function(e,t,n){"use strict";var r=n(8381),i="undefined"!==typeof window?r.useLayoutEffect:r.useEffect;t.Z=i},1711:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(8381),i=n(2371);function o(e){var t=r.useRef(e);return(0,i.Z)((function(){t.current=e})),r.useCallback((function(){return t.current.apply(void 0,arguments)}),[])}},8444:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(8381),i=n(9863);function o(){for(var e=arguments.length,t=new Array(e),n=0;n-1};function u(e){if("string"!==typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function c(e){return"string"!==typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function v(e){var t=new FileReader,n=h(t);return t.readAsArrayBuffer(e),n}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"===typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||s(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"===typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,n=h(t);return t.readAsText(e),n}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?t:e}(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function x(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function w(e){var t=new f;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t}function C(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},g.call(y.prototype),g.call(C.prototype),C.prototype.clone=function(){return new C(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},C.error=function(){var e=new C(null,{status:0,statusText:""});return e.type="error",e};var k=[301,302,303,307,308];C.redirect=function(e,t){if(-1===k.indexOf(t))throw new RangeError("Invalid status code");return new C(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(S){t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,n){return new Promise((function(r,o){var a=new y(e,n);if(a.signal&&a.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var l=new XMLHttpRequest;function s(){l.abort()}l.onload=function(){var e={status:l.status,statusText:l.statusText,headers:w(l.getAllResponseHeaders()||"")};e.url="responseURL"in l?l.responseURL:e.headers.get("X-Request-URL");var t="response"in l?l.response:l.responseText;r(new C(t,e))},l.onerror=function(){o(new TypeError("Network request failed"))},l.ontimeout=function(){o(new TypeError("Network request failed"))},l.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},l.open(a.method,a.url,!0),"include"===a.credentials?l.withCredentials=!0:"omit"===a.credentials&&(l.withCredentials=!1),"responseType"in l&&i&&(l.responseType="blob"),a.headers.forEach((function(e,t){l.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",s),l.onreadystatechange=function(){4===l.readyState&&a.signal.removeEventListener("abort",s)}),l.send("undefined"===typeof a._bodyInit?null:a._bodyInit)}))}E.polyfill=!0,e.fetch||(e.fetch=E,e.Headers=f,e.Request=y,e.Response=C),t.Headers=f,t.Request=y,t.Response=C,t.fetch=E,Object.defineProperty(t,"__esModule",{value:!0})}({})}(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},4413:function(e){"use strict";e.exports=function(e){var t=e.uri,n=e.name,r=e.type;this.uri=t,this.name=n,this.type=r}},7809:function(e,t,n){"use strict";var r=n(369);e.exports=function e(t,n,i){var o;void 0===n&&(n=""),void 0===i&&(i=r);var a=new Map;function l(e,t){var n=a.get(t);n?n.push.apply(n,e):a.set(t,e)}if(i(t))o=null,l([n],t);else{var s=n?n+".":"";if("undefined"!==typeof FileList&&t instanceof FileList)o=Array.prototype.map.call(t,(function(e,t){return l([""+s+t],e),null}));else if(Array.isArray(t))o=t.map((function(t,n){var r=e(t,""+s+n,i);return r.files.forEach(l),r.clone}));else if(t&&t.constructor===Object)for(var u in o={},t){var c=e(t[u],""+s+u,i);c.files.forEach(l),o[u]=c.clone}else o=t}return{clone:o,files:a}}},9068:function(e,t,n){"use strict";t.ReactNativeFile=n(4413),t.extractFiles=n(7809),t.isExtractableFile=n(369)},369:function(e,t,n){"use strict";var r=n(4413);e.exports=function(e){return"undefined"!==typeof File&&e instanceof File||"undefined"!==typeof Blob&&e instanceof Blob||e instanceof r}},387:function(e){e.exports="object"==typeof self?self.FormData:window.FormData},1762:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(9068),o=r(n(387)),a=function(e){return i.isExtractableFile(e)||null!==e&&"object"===typeof e&&"function"===typeof e.pipe};t.default=function(e,t,n){var r=i.extractFiles({query:e,variables:t,operationName:n},"",a),l=r.clone,s=r.files;if(0===s.size){if(!Array.isArray(e))return JSON.stringify(l);if("undefined"!==typeof t&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");var u=e.reduce((function(e,n,r){return e.push({query:n,variables:t?t[r]:void 0}),e}),[]);return JSON.stringify(u)}var c=new("undefined"===typeof FormData?o.default:FormData);c.append("operations",JSON.stringify(l));var d={},f=0;return s.forEach((function(e){d[++f]=e})),c.append("map",JSON.stringify(d)),f=0,s.forEach((function(e,t){c.append(""+ ++f,t)})),c}},3821:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var n=0;n
\n));\nTabRoot.displayName = 'Tab';\n\nconst TabButton = forwardRef<\n HTMLButtonElement,\n JSX.IntrinsicElements['button']\n>((props, ref) => (\n \n {props.children}\n \n));\nTabButton.displayName = 'Tab.Button';\n\nconst TabClose = forwardRef(\n (props, ref) => (\n \n \n \n \n \n ),\n);\nTabClose.displayName = 'Tab.Close';\n\nexport const Tab = createComponentGroup(TabRoot, {\n Button: TabButton,\n Close: TabClose,\n});\n\nexport const Tabs = forwardRef(\n (props, ref) => (\n \n {props.children}\n
\n ),\n);\nTabs.displayName = 'Tabs';\n","import { HistoryStore, QueryStoreItem, StorageAPI } from '@graphiql/toolkit';\nimport { ReactNode, useCallback, useMemo, useRef, useState } from 'react';\n\nimport { useStorageContext } from '../storage';\nimport { createContextHook, createNullableContext } from '../utility/context';\n\nexport type HistoryContextType = {\n /**\n * Add an operation to the history.\n * @param operation The operation that was executed, consisting of the query,\n * variables, headers and the operation name.\n */\n addToHistory(operation: {\n query?: string;\n variables?: string;\n headers?: string;\n operationName?: string;\n }): void;\n /**\n * Change the custom label of an item from the history.\n * @param args An object containing the label (`undefined` if it should be\n * unset) and properties that identify the history item that the label should\n * be applied to. (This can result in the label being applied to multiple\n * history items.)\n */\n editLabel(args: {\n query?: string;\n variables?: string;\n headers?: string;\n operationName?: string;\n label?: string;\n favorite?: boolean;\n }): void;\n /**\n * The list of history items.\n */\n items: readonly QueryStoreItem[];\n /**\n * Toggle the favorite state of an item from the history.\n * @param args An object containing the favorite state (`undefined` if it\n * should be unset) and properties that identify the history item that the\n * label should be applied to. (This can result in the label being applied\n * to multiple history items.)\n */\n toggleFavorite(args: {\n query?: string;\n variables?: string;\n headers?: string;\n operationName?: string;\n label?: string;\n favorite?: boolean;\n }): void;\n};\n\nexport const HistoryContext =\n createNullableContext('HistoryContext');\n\nexport type HistoryContextProviderProps = {\n children: ReactNode;\n /**\n * The maximum number of executed operations to store.\n * @default 20\n */\n maxHistoryLength?: number;\n};\n\nexport function HistoryContextProvider(props: HistoryContextProviderProps) {\n const storage = useStorageContext();\n const historyStore = useRef(\n new HistoryStore(\n // Fall back to a noop storage when the StorageContext is empty\n storage || new StorageAPI(null),\n props.maxHistoryLength || DEFAULT_HISTORY_LENGTH,\n ),\n );\n const [items, setItems] = useState(historyStore.current?.queries || []);\n\n const addToHistory: HistoryContextType['addToHistory'] = useCallback(\n ({ query, variables, headers, operationName }) => {\n historyStore.current?.updateHistory(\n query,\n variables,\n headers,\n operationName,\n );\n setItems(historyStore.current.queries);\n },\n [],\n );\n\n const editLabel: HistoryContextType['editLabel'] = useCallback(\n ({ query, variables, headers, operationName, label, favorite }) => {\n historyStore.current.editLabel(\n query,\n variables,\n headers,\n operationName,\n label,\n favorite,\n );\n setItems(historyStore.current.queries);\n },\n [],\n );\n\n const toggleFavorite: HistoryContextType['toggleFavorite'] = useCallback(\n ({ query, variables, headers, operationName, label, favorite }) => {\n historyStore.current.toggleFavorite(\n query,\n variables,\n headers,\n operationName,\n label,\n favorite,\n );\n setItems(historyStore.current.queries);\n },\n [],\n );\n\n const value = useMemo(\n () => ({ addToHistory, editLabel, items, toggleFavorite }),\n [addToHistory, editLabel, items, toggleFavorite],\n );\n\n return (\n \n {props.children}\n \n );\n}\n\nexport const useHistoryContext =\n createContextHook(HistoryContext);\n\nconst DEFAULT_HISTORY_LENGTH = 20;\n","import { QueryStoreItem } from '@graphiql/toolkit';\nimport { Fragment, useEffect, useRef, useState } from 'react';\nimport { clsx } from 'clsx';\n\nimport { useEditorContext } from '../editor';\nimport { CloseIcon, PenIcon, StarFilledIcon, StarIcon } from '../icons';\nimport { Tooltip, UnStyledButton } from '../ui';\nimport { useHistoryContext } from './context';\n\nimport './style.css';\n\nexport function History() {\n const { items } = useHistoryContext({ nonNull: true });\n const reversedItems = items.slice().reverse();\n return (\n
\n
History
\n
    \n {reversedItems.map((item, i) => {\n return (\n \n \n {/**\n * The (reversed) items are ordered in a way that all favorites\n * come first, so if the next item is not a favorite anymore we\n * place a spacer between them to separate these groups.\n */}\n {item.favorite &&\n reversedItems[i + 1] &&\n !reversedItems[i + 1].favorite ? (\n
    \n ) : null}\n \n );\n })}\n
\n
\n );\n}\n\ntype QueryHistoryItemProps = {\n item: QueryStoreItem;\n};\n\nexport function HistoryItem(props: QueryHistoryItemProps) {\n const { editLabel, toggleFavorite } = useHistoryContext({\n nonNull: true,\n caller: HistoryItem,\n });\n const { headerEditor, queryEditor, variableEditor } = useEditorContext({\n nonNull: true,\n caller: HistoryItem,\n });\n const inputRef = useRef(null);\n const buttonRef = useRef(null);\n const [isEditable, setIsEditable] = useState(false);\n\n useEffect(() => {\n if (isEditable && inputRef.current) {\n inputRef.current.focus();\n }\n }, [isEditable]);\n\n const displayName =\n props.item.label ||\n props.item.operationName ||\n formatQuery(props.item.query);\n\n return (\n
  • \n {isEditable ? (\n <>\n {\n if (e.keyCode === 27) {\n // Escape\n setIsEditable(false);\n } else if (e.keyCode === 13) {\n // Enter\n setIsEditable(false);\n editLabel({ ...props.item, label: e.currentTarget.value });\n }\n }}\n placeholder=\"Type a label\"\n />\n {\n setIsEditable(false);\n editLabel({ ...props.item, label: inputRef.current?.value });\n }}\n >\n Save\n \n {\n setIsEditable(false);\n }}\n >\n \n \n \n ) : (\n <>\n {\n queryEditor?.setValue(props.item.query ?? '');\n variableEditor?.setValue(props.item.variables ?? '');\n headerEditor?.setValue(props.item.headers ?? '');\n }}\n >\n {displayName}\n \n \n {\n e.stopPropagation();\n setIsEditable(true);\n }}\n aria-label=\"Edit label\"\n >\n \n \n \n \n {\n e.stopPropagation();\n toggleFavorite(props.item);\n }}\n aria-label={\n props.item.favorite ? 'Remove favorite' : 'Add favorite'\n }\n >\n {props.item.favorite ? (\n \n ) : (\n \n )}\n \n \n \n )}\n
  • \n );\n}\n\nexport function formatQuery(query?: string) {\n return query\n ?.split('\\n')\n .map(line => line.replace(/#(.*)/, ''))\n .join(' ')\n .replaceAll('{', ' { ')\n .replaceAll('}', ' } ')\n .replaceAll(/[\\s]{2,}/g, ' ');\n}\n","import {\n Fetcher,\n FetcherResultPayload,\n formatError,\n formatResult,\n isAsyncIterable,\n isObservable,\n Unsubscribable,\n} from '@graphiql/toolkit';\nimport { ExecutionResult, FragmentDefinitionNode, print } from 'graphql';\nimport { getFragmentDependenciesForAST } from 'graphql-language-service';\nimport { ReactNode, useCallback, useMemo, useRef, useState } from 'react';\nimport setValue from 'set-value';\n\nimport { useAutoCompleteLeafs, useEditorContext } from './editor';\nimport { UseAutoCompleteLeafsArgs } from './editor/hooks';\nimport { useHistoryContext } from './history';\nimport { createContextHook, createNullableContext } from './utility/context';\n\nexport type ExecutionContextType = {\n /**\n * If there is currently a GraphQL request in-flight. For multi-part\n * requests like subscriptions, this will be `true` while fetching the\n * first partial response and `false` while fetching subsequent batches.\n */\n isFetching: boolean;\n /**\n * If there is currently a GraphQL request in-flight. For multi-part\n * requests like subscriptions, this will be `true` until the last batch\n * has been fetched or the connection is closed from the client.\n */\n isSubscribed: boolean;\n /**\n * The operation name that will be sent with all GraphQL requests.\n */\n operationName: string | null;\n /**\n * Start a GraphQL requests based of the current editor contents.\n */\n run(): void;\n /**\n * Stop the GraphQL request that is currently in-flight.\n */\n stop(): void;\n};\n\nexport const ExecutionContext =\n createNullableContext('ExecutionContext');\n\nexport type ExecutionContextProviderProps = Pick<\n UseAutoCompleteLeafsArgs,\n 'getDefaultFieldNames'\n> & {\n children: ReactNode;\n /**\n * A function which accepts GraphQL HTTP parameters and returns a `Promise`,\n * `Observable` or `AsyncIterable` that returns the GraphQL response in\n * parsed JSON format.\n *\n * We suggest using the `createGraphiQLFetcher` utility from `@graphiql/toolkit`\n * to create these fetcher functions.\n *\n * @see {@link https://graphiql-test.netlify.app/typedoc/modules/graphiql_toolkit.html#creategraphiqlfetcher-2|`createGraphiQLFetcher`}\n */\n fetcher: Fetcher;\n /**\n * This prop sets the operation name that is passed with a GraphQL request.\n */\n operationName?: string;\n};\n\nexport function ExecutionContextProvider({\n fetcher,\n getDefaultFieldNames,\n children,\n operationName,\n}: ExecutionContextProviderProps) {\n if (!fetcher) {\n throw new TypeError(\n 'The `ExecutionContextProvider` component requires a `fetcher` function to be passed as prop.',\n );\n }\n\n const {\n externalFragments,\n headerEditor,\n queryEditor,\n responseEditor,\n variableEditor,\n updateActiveTabValues,\n } = useEditorContext({ nonNull: true, caller: ExecutionContextProvider });\n const history = useHistoryContext();\n const autoCompleteLeafs = useAutoCompleteLeafs({\n getDefaultFieldNames,\n caller: ExecutionContextProvider,\n });\n const [isFetching, setIsFetching] = useState(false);\n const [subscription, setSubscription] = useState(null);\n const queryIdRef = useRef(0);\n\n const stop = useCallback(() => {\n subscription?.unsubscribe();\n setIsFetching(false);\n setSubscription(null);\n }, [subscription]);\n\n const run = useCallback(async () => {\n if (!queryEditor || !responseEditor) {\n return;\n }\n\n // If there's an active subscription, unsubscribe it and return\n if (subscription) {\n stop();\n return;\n }\n\n const setResponse = (value: string) => {\n responseEditor.setValue(value);\n updateActiveTabValues({ response: value });\n };\n\n queryIdRef.current += 1;\n const queryId = queryIdRef.current;\n\n // Use the edited query after autoCompleteLeafs() runs or,\n // in case autoCompletion fails (the function returns undefined),\n // the current query from the editor.\n let query = autoCompleteLeafs() || queryEditor.getValue();\n\n const variablesString = variableEditor?.getValue();\n let variables: Record | undefined;\n try {\n variables = tryParseJsonObject({\n json: variablesString,\n errorMessageParse: 'Variables are invalid JSON',\n errorMessageType: 'Variables are not a JSON object.',\n });\n } catch (error) {\n setResponse(error instanceof Error ? error.message : `${error}`);\n return;\n }\n\n const headersString = headerEditor?.getValue();\n let headers: Record | undefined;\n try {\n headers = tryParseJsonObject({\n json: headersString,\n errorMessageParse: 'Headers are invalid JSON',\n errorMessageType: 'Headers are not a JSON object.',\n });\n } catch (error) {\n setResponse(error instanceof Error ? error.message : `${error}`);\n return;\n }\n\n if (externalFragments) {\n const fragmentDependencies = queryEditor.documentAST\n ? getFragmentDependenciesForAST(\n queryEditor.documentAST,\n externalFragments,\n )\n : [];\n if (fragmentDependencies.length > 0) {\n query +=\n '\\n' +\n fragmentDependencies\n .map((node: FragmentDefinitionNode) => print(node))\n .join('\\n');\n }\n }\n\n setResponse('');\n setIsFetching(true);\n\n const opName = operationName ?? queryEditor.operationName ?? undefined;\n\n history?.addToHistory({\n query,\n variables: variablesString,\n headers: headersString,\n operationName: opName,\n });\n\n try {\n let fullResponse: FetcherResultPayload = { data: {} };\n const handleResponse = (result: ExecutionResult) => {\n // A different query was dispatched in the meantime, so don't\n // show the results of this one.\n if (queryId !== queryIdRef.current) {\n return;\n }\n\n let maybeMultipart = Array.isArray(result) ? result : false;\n if (\n !maybeMultipart &&\n typeof result === 'object' &&\n result !== null &&\n 'hasNext' in result\n ) {\n maybeMultipart = [result];\n }\n\n if (maybeMultipart) {\n const payload: FetcherResultPayload = {\n data: fullResponse.data,\n };\n const maybeErrors = [\n ...(fullResponse?.errors || []),\n ...maybeMultipart.flatMap(i => i.errors).filter(Boolean),\n ];\n\n if (maybeErrors.length) {\n payload.errors = maybeErrors;\n }\n\n for (const part of maybeMultipart) {\n // We pull out errors here, so we dont include it later\n const { path, data, errors, ...rest } = part;\n if (path) {\n if (!data) {\n throw new Error(\n `Expected part to contain a data property, but got ${part}`,\n );\n }\n\n setValue(payload.data, path, data, { merge: true });\n } else if (data) {\n // If there is no path, we don't know what to do with the payload,\n // so we just set it.\n payload.data = data;\n }\n\n // Ensures we also bring extensions and alike along for the ride\n fullResponse = {\n ...payload,\n ...rest,\n };\n }\n\n setIsFetching(false);\n setResponse(formatResult(fullResponse));\n } else {\n const response = formatResult(result);\n setIsFetching(false);\n setResponse(response);\n }\n };\n\n const fetch = fetcher(\n {\n query,\n variables,\n operationName: opName,\n },\n {\n headers: headers ?? undefined,\n documentAST: queryEditor.documentAST ?? undefined,\n },\n );\n\n const value = await Promise.resolve(fetch);\n if (isObservable(value)) {\n // If the fetcher returned an Observable, then subscribe to it, calling\n // the callback on each next value, and handling both errors and the\n // completion of the Observable.\n setSubscription(\n value.subscribe({\n next(result) {\n handleResponse(result);\n },\n error(error: Error) {\n setIsFetching(false);\n if (error) {\n setResponse(formatError(error));\n }\n setSubscription(null);\n },\n complete() {\n setIsFetching(false);\n setSubscription(null);\n },\n }),\n );\n } else if (isAsyncIterable(value)) {\n setSubscription({\n unsubscribe: () => value[Symbol.asyncIterator]().return?.(),\n });\n for await (const result of value) {\n handleResponse(result);\n }\n setIsFetching(false);\n setSubscription(null);\n } else {\n handleResponse(value);\n }\n } catch (error) {\n setIsFetching(false);\n setResponse(formatError(error));\n setSubscription(null);\n }\n }, [\n autoCompleteLeafs,\n externalFragments,\n fetcher,\n headerEditor,\n history,\n operationName,\n queryEditor,\n responseEditor,\n stop,\n subscription,\n updateActiveTabValues,\n variableEditor,\n ]);\n\n const isSubscribed = Boolean(subscription);\n const value = useMemo(\n () => ({\n isFetching,\n isSubscribed,\n operationName: operationName ?? null,\n run,\n stop,\n }),\n [isFetching, isSubscribed, operationName, run, stop],\n );\n\n return (\n \n {children}\n \n );\n}\n\nexport const useExecutionContext = createContextHook(ExecutionContext);\n\nfunction tryParseJsonObject({\n json,\n errorMessageParse,\n errorMessageType,\n}: {\n json: string | undefined;\n errorMessageParse: string;\n errorMessageType: string;\n}) {\n let parsed: Record | undefined = undefined;\n try {\n parsed = json && json.trim() !== '' ? JSON.parse(json) : undefined;\n } catch (error) {\n throw new Error(\n `${errorMessageParse}: ${\n error instanceof Error ? error.message : error\n }.`,\n );\n }\n const isObject =\n typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed);\n if (parsed !== undefined && !isObject) {\n throw new Error(errorMessageType);\n }\n return parsed;\n}\n","import { KeyMap } from './types';\n\nexport const DEFAULT_EDITOR_THEME = 'graphiql';\nexport const DEFAULT_KEY_MAP: KeyMap = 'sublime';\n\nlet isMacOs = false;\n\nif (typeof window === 'object') {\n isMacOs = window.navigator.platform.toLowerCase().indexOf('mac') === 0;\n}\n\nexport const commonKeys = {\n // Persistent search box in Query Editor\n [isMacOs ? 'Cmd-F' : 'Ctrl-F']: 'findPersistent',\n 'Cmd-G': 'findPersistent',\n 'Ctrl-G': 'findPersistent',\n\n // Editor improvements\n 'Ctrl-Left': 'goSubwordLeft',\n 'Ctrl-Right': 'goSubwordRight',\n 'Alt-Left': 'goGroupLeft',\n 'Alt-Right': 'goGroupRight',\n};\n\n/**\n * Dynamically import codemirror and dependencies\n * This works for codemirror 5, not sure if the same imports work for 6\n */\nexport async function importCodeMirror(\n addons: Promise[],\n options?: { useCommonAddons?: boolean },\n) {\n const CodeMirror = await import('codemirror').then(c =>\n // Depending on bundler and settings the dynamic import either returns a\n // function (e.g. parcel) or an object containing a `default` property\n typeof c === 'function' ? c : c.default,\n );\n await Promise.all(\n options?.useCommonAddons === false\n ? addons\n : [\n import('codemirror/addon/hint/show-hint'),\n import('codemirror/addon/edit/matchbrackets'),\n import('codemirror/addon/edit/closebrackets'),\n import('codemirror/addon/fold/brace-fold'),\n import('codemirror/addon/fold/foldgutter'),\n import('codemirror/addon/lint/lint'),\n import('codemirror/addon/search/searchcursor'),\n import('codemirror/addon/search/jump-to-line'),\n import('codemirror/addon/dialog/dialog'),\n // @ts-expect-error\n import('codemirror/keymap/sublime'),\n ...addons,\n ],\n );\n return CodeMirror;\n}\n","\nmodule.exports = function () {\n var selection = document.getSelection();\n if (!selection.rangeCount) {\n return function () {};\n }\n var active = document.activeElement;\n\n var ranges = [];\n for (var i = 0; i < selection.rangeCount; i++) {\n ranges.push(selection.getRangeAt(i));\n }\n\n switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML\n case 'INPUT':\n case 'TEXTAREA':\n active.blur();\n break;\n\n default:\n active = null;\n break;\n }\n\n selection.removeAllRanges();\n return function () {\n selection.type === 'Caret' &&\n selection.removeAllRanges();\n\n if (!selection.rangeCount) {\n ranges.forEach(function(range) {\n selection.addRange(range);\n });\n }\n\n active &&\n active.focus();\n };\n};\n","\"use strict\";\n\nvar deselectCurrent = require(\"toggle-selection\");\n\nvar clipboardToIE11Formatting = {\n \"text/plain\": \"Text\",\n \"text/html\": \"Url\",\n \"default\": \"Text\"\n}\n\nvar defaultMessage = \"Copy to clipboard: #{key}, Enter\";\n\nfunction format(message) {\n var copyKey = (/mac os x/i.test(navigator.userAgent) ? \"⌘\" : \"Ctrl\") + \"+C\";\n return message.replace(/#{\\s*key\\s*}/g, copyKey);\n}\n\nfunction copy(text, options) {\n var debug,\n message,\n reselectPrevious,\n range,\n selection,\n mark,\n success = false;\n if (!options) {\n options = {};\n }\n debug = options.debug || false;\n try {\n reselectPrevious = deselectCurrent();\n\n range = document.createRange();\n selection = document.getSelection();\n\n mark = document.createElement(\"span\");\n mark.textContent = text;\n // avoid screen readers from reading out loud the text\n mark.ariaHidden = \"true\"\n // reset user styles for span element\n mark.style.all = \"unset\";\n // prevents scrolling to the end of the page\n mark.style.position = \"fixed\";\n mark.style.top = 0;\n mark.style.clip = \"rect(0, 0, 0, 0)\";\n // used to preserve spaces and line breaks\n mark.style.whiteSpace = \"pre\";\n // do not inherit user-select (it may be `none`)\n mark.style.webkitUserSelect = \"text\";\n mark.style.MozUserSelect = \"text\";\n mark.style.msUserSelect = \"text\";\n mark.style.userSelect = \"text\";\n mark.addEventListener(\"copy\", function(e) {\n e.stopPropagation();\n if (options.format) {\n e.preventDefault();\n if (typeof e.clipboardData === \"undefined\") { // IE 11\n debug && console.warn(\"unable to use e.clipboardData\");\n debug && console.warn(\"trying IE specific stuff\");\n window.clipboardData.clearData();\n var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting[\"default\"]\n window.clipboardData.setData(format, text);\n } else { // all other browsers\n e.clipboardData.clearData();\n e.clipboardData.setData(options.format, text);\n }\n }\n if (options.onCopy) {\n e.preventDefault();\n options.onCopy(e.clipboardData);\n }\n });\n\n document.body.appendChild(mark);\n\n range.selectNodeContents(mark);\n selection.addRange(range);\n\n var successful = document.execCommand(\"copy\");\n if (!successful) {\n throw new Error(\"copy command was unsuccessful\");\n }\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using execCommand: \", err);\n debug && console.warn(\"trying IE specific stuff\");\n try {\n window.clipboardData.setData(options.format || \"text\", text);\n options.onCopy && options.onCopy(window.clipboardData);\n success = true;\n } catch (err) {\n debug && console.error(\"unable to copy using clipboardData: \", err);\n debug && console.error(\"falling back to prompt\");\n message = format(\"message\" in options ? options.message : defaultMessage);\n window.prompt(message, text);\n }\n } finally {\n if (selection) {\n if (typeof selection.removeRange == \"function\") {\n selection.removeRange(range);\n } else {\n selection.removeAllRanges();\n }\n }\n\n if (mark) {\n document.body.removeChild(mark);\n }\n reselectPrevious();\n }\n\n return success;\n}\n\nmodule.exports = copy;\n","import { astFromValue, print, ValueNode } from 'graphql';\n\nimport { ExplorerFieldDef } from '../context';\n\nimport './default-value.css';\n\nconst printDefault = (ast?: ValueNode | null): string => {\n if (!ast) {\n return '';\n }\n return print(ast);\n};\n\ntype DefaultValueProps = {\n /**\n * The field or argument for which to render the default value.\n */\n field: ExplorerFieldDef;\n};\n\nexport function DefaultValue({ field }: DefaultValueProps) {\n if (!('defaultValue' in field) || field.defaultValue === undefined) {\n return null;\n }\n const ast = astFromValue(field.defaultValue, field.type);\n if (!ast) {\n return null;\n }\n return (\n <>\n {' = '}\n \n {printDefault(ast)}\n \n \n );\n}\n","import {\n Fetcher,\n FetcherOpts,\n fetcherReturnToPromise,\n formatError,\n formatResult,\n isPromise,\n} from '@graphiql/toolkit';\nimport {\n buildClientSchema,\n getIntrospectionQuery,\n GraphQLError,\n GraphQLSchema,\n IntrospectionQuery,\n isSchema,\n validateSchema,\n} from 'graphql';\nimport {\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { useEditorContext } from './editor';\nimport { createContextHook, createNullableContext } from './utility/context';\n\ntype MaybeGraphQLSchema = GraphQLSchema | null | undefined;\n\nexport type SchemaContextType = {\n /**\n * Stores an error raised during introspecting or building the GraphQL schema\n * from the introspection result.\n */\n fetchError: string | null;\n /**\n * Trigger building the GraphQL schema. This might trigger an introspection\n * request if no schema is passed via props and if using a schema is not\n * explicitly disabled by passing `null` as value for the `schema` prop. If\n * there is a schema (either fetched using introspection or passed via props)\n * it will be validated, unless this is explicitly skipped using the\n * `dangerouslyAssumeSchemaIsValid` prop.\n */\n introspect(): void;\n /**\n * If there currently is an introspection request in-flight.\n */\n isFetching: boolean;\n /**\n * The current GraphQL schema.\n */\n schema: MaybeGraphQLSchema;\n /**\n * A list of errors from validating the current GraphQL schema. The schema is\n * valid if and only if this list is empty.\n */\n validationErrors: readonly GraphQLError[];\n};\n\nexport const SchemaContext =\n createNullableContext('SchemaContext');\n\nexport type SchemaContextProviderProps = {\n children: ReactNode;\n /**\n * This prop can be used to skip validating the GraphQL schema. This applies\n * to both schemas fetched via introspection and schemas explicitly passed\n * via the `schema` prop.\n *\n * IMPORTANT NOTE: Without validating the schema, GraphiQL and its components\n * are vulnerable to numerous exploits and might break. Only use this prop if\n * you have full control over the schema passed to GraphiQL.\n *\n * @default false\n */\n dangerouslyAssumeSchemaIsValid?: boolean;\n /**\n * A function which accepts GraphQL HTTP parameters and returns a `Promise`,\n * `Observable` or `AsyncIterable` that returns the GraphQL response in\n * parsed JSON format.\n *\n * We suggest using the `createGraphiQLFetcher` utility from `@graphiql/toolkit`\n * to create these fetcher functions.\n *\n * @see {@link https://graphiql-test.netlify.app/typedoc/modules/graphiql_toolkit.html#creategraphiqlfetcher-2|`createGraphiQLFetcher`}\n */\n fetcher: Fetcher;\n /**\n * Invoked after a new GraphQL schema was built. This includes both fetching\n * the schema via introspection and passing the schema using the `schema`\n * prop.\n * @param schema The GraphQL schema that is now used for GraphiQL.\n */\n onSchemaChange?(schema: GraphQLSchema): void;\n /**\n * Explicitly provide the GraphiQL schema that shall be used for GraphiQL.\n * If this props is...\n * - ...passed and the value is a GraphQL schema, it will be validated and\n * then used for GraphiQL if it is valid.\n * - ...passed and the value is the result of an introspection query, a\n * GraphQL schema will be built from this introspection data, it will be\n * validated, and then used for GraphiQL if it is valid.\n * - ...set to `null`, no introspection request will be triggered and\n * GraphiQL will run without a schema.\n * - ...set to `undefined` or not set at all, an introspection request will\n * be triggered. If this request succeeds, a GraphQL schema will be built\n * from the returned introspection data, it will be validated, and then\n * used for GraphiQL if it is valid. If this request fails, GraphiQL will\n * run without a schema.\n */\n schema?: GraphQLSchema | IntrospectionQuery | null;\n} & IntrospectionArgs;\n\nexport function SchemaContextProvider(props: SchemaContextProviderProps) {\n if (!props.fetcher) {\n throw new TypeError(\n 'The `SchemaContextProvider` component requires a `fetcher` function to be passed as prop.',\n );\n }\n\n const { initialHeaders, headerEditor } = useEditorContext({\n nonNull: true,\n caller: SchemaContextProvider,\n });\n const [schema, setSchema] = useState();\n const [isFetching, setIsFetching] = useState(false);\n const [fetchError, setFetchError] = useState(null);\n\n /**\n * A counter that is incremented each time introspection is triggered or the\n * schema state is updated.\n */\n const counterRef = useRef(0);\n\n /**\n * Synchronize prop changes with state\n */\n useEffect(() => {\n setSchema(\n isSchema(props.schema) ||\n props.schema === null ||\n props.schema === undefined\n ? props.schema\n : undefined,\n );\n\n /**\n * Increment the counter so that in-flight introspection requests don't\n * override this change.\n */\n counterRef.current++;\n }, [props.schema]);\n\n /**\n * Keep a ref to the current headers\n */\n const headersRef = useRef(initialHeaders);\n useEffect(() => {\n if (headerEditor) {\n headersRef.current = headerEditor.getValue();\n }\n });\n\n /**\n * Get introspection query for settings given via props\n */\n const {\n introspectionQuery,\n introspectionQueryName,\n introspectionQuerySansSubscriptions,\n } = useIntrospectionQuery({\n inputValueDeprecation: props.inputValueDeprecation,\n introspectionQueryName: props.introspectionQueryName,\n schemaDescription: props.schemaDescription,\n });\n\n /**\n * Fetch the schema\n */\n const { fetcher, onSchemaChange, dangerouslyAssumeSchemaIsValid, children } =\n props;\n const introspect = useCallback(() => {\n /**\n * Only introspect if there is no schema provided via props. If the\n * prop is passed an introspection result, we do continue but skip the\n * introspection request.\n */\n if (isSchema(props.schema) || props.schema === null) {\n return;\n }\n\n const counter = ++counterRef.current;\n\n const maybeIntrospectionData = props.schema;\n async function fetchIntrospectionData() {\n if (maybeIntrospectionData) {\n // No need to introspect if we already have the data\n return maybeIntrospectionData;\n }\n\n const parsedHeaders = parseHeaderString(headersRef.current);\n if (!parsedHeaders.isValidJSON) {\n setFetchError('Introspection failed as headers are invalid.');\n return;\n }\n\n const fetcherOpts: FetcherOpts = parsedHeaders.headers\n ? { headers: parsedHeaders.headers }\n : {};\n\n const fetch = fetcherReturnToPromise(\n fetcher(\n {\n query: introspectionQuery,\n operationName: introspectionQueryName,\n },\n fetcherOpts,\n ),\n );\n\n if (!isPromise(fetch)) {\n setFetchError('Fetcher did not return a Promise for introspection.');\n return;\n }\n\n setIsFetching(true);\n setFetchError(null);\n\n let result = await fetch;\n\n if (\n typeof result !== 'object' ||\n result === null ||\n !('data' in result)\n ) {\n // Try the stock introspection query first, falling back on the\n // sans-subscriptions query for services which do not yet support it.\n const fetch2 = fetcherReturnToPromise(\n fetcher(\n {\n query: introspectionQuerySansSubscriptions,\n operationName: introspectionQueryName,\n },\n fetcherOpts,\n ),\n );\n if (!isPromise(fetch2)) {\n throw new Error(\n 'Fetcher did not return a Promise for introspection.',\n );\n }\n result = await fetch2;\n }\n\n setIsFetching(false);\n\n if (result?.data && '__schema' in result.data) {\n return result.data as IntrospectionQuery;\n }\n\n // handle as if it were an error if the fetcher response is not a string or response.data is not present\n const responseString =\n typeof result === 'string' ? result : formatResult(result);\n setFetchError(responseString);\n }\n\n fetchIntrospectionData()\n .then(introspectionData => {\n /**\n * Don't continue if another introspection request has been started in\n * the meantime or if there is no introspection data.\n */\n if (counter !== counterRef.current || !introspectionData) {\n return;\n }\n\n try {\n const newSchema = buildClientSchema(introspectionData);\n setSchema(newSchema);\n onSchemaChange?.(newSchema);\n } catch (error) {\n setFetchError(formatError(error));\n }\n })\n .catch(error => {\n /**\n * Don't continue if another introspection request has been started in\n * the meantime.\n */\n if (counter !== counterRef.current) {\n return;\n }\n\n setFetchError(formatError(error));\n setIsFetching(false);\n });\n }, [\n fetcher,\n introspectionQueryName,\n introspectionQuery,\n introspectionQuerySansSubscriptions,\n onSchemaChange,\n props.schema,\n ]);\n\n /**\n * Trigger introspection automatically\n */\n useEffect(() => {\n introspect();\n }, [introspect]);\n\n /**\n * Trigger introspection manually via short key\n */\n useEffect(() => {\n function triggerIntrospection(event: KeyboardEvent) {\n if (event.keyCode === 82 && event.shiftKey && event.ctrlKey) {\n introspect();\n }\n }\n window.addEventListener('keydown', triggerIntrospection);\n return () => window.removeEventListener('keydown', triggerIntrospection);\n });\n\n /**\n * Derive validation errors from the schema\n */\n const validationErrors = useMemo(() => {\n if (!schema || dangerouslyAssumeSchemaIsValid) {\n return [];\n }\n return validateSchema(schema);\n }, [schema, dangerouslyAssumeSchemaIsValid]);\n\n /**\n * Memoize context value\n */\n const value = useMemo(\n () => ({\n fetchError,\n introspect,\n isFetching,\n schema,\n validationErrors,\n }),\n [fetchError, introspect, isFetching, schema, validationErrors],\n );\n\n return (\n {children}\n );\n}\n\nexport const useSchemaContext = createContextHook(SchemaContext);\n\ntype IntrospectionArgs = {\n /**\n * Can be used to set the equally named option for introspecting a GraphQL\n * server.\n * @default false\n * @see {@link https://github.com/graphql/graphql-js/blob/main/src/utilities/getIntrospectionQuery.ts|Utility for creating the introspection query}\n */\n inputValueDeprecation?: boolean;\n /**\n * Can be used to set a custom operation name for the introspection query.\n */\n introspectionQueryName?: string;\n /**\n * Can be used to set the equally named option for introspecting a GraphQL\n * server.\n * @default false\n * @see {@link https://github.com/graphql/graphql-js/blob/main/src/utilities/getIntrospectionQuery.ts|Utility for creating the introspection query}\n */\n schemaDescription?: boolean;\n};\n\nfunction useIntrospectionQuery({\n inputValueDeprecation,\n introspectionQueryName,\n schemaDescription,\n}: IntrospectionArgs) {\n return useMemo(() => {\n const queryName = introspectionQueryName || 'IntrospectionQuery';\n\n let query = getIntrospectionQuery({\n inputValueDeprecation,\n schemaDescription,\n });\n if (introspectionQueryName) {\n query = query.replace('query IntrospectionQuery', `query ${queryName}`);\n }\n\n const querySansSubscriptions = query.replace(\n 'subscriptionType { name }',\n '',\n );\n\n return {\n introspectionQueryName: queryName,\n introspectionQuery: query,\n introspectionQuerySansSubscriptions: querySansSubscriptions,\n };\n }, [inputValueDeprecation, introspectionQueryName, schemaDescription]);\n}\n\nfunction parseHeaderString(headersString: string | undefined) {\n let headers: Record | null = null;\n let isValidJSON = true;\n\n try {\n if (headersString) {\n headers = JSON.parse(headersString);\n }\n } catch {\n isValidJSON = false;\n }\n return { headers, isValidJSON };\n}\n","import type {\n GraphQLArgument,\n GraphQLField,\n GraphQLInputField,\n GraphQLNamedType,\n} from 'graphql';\nimport {\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isNamedType,\n isObjectType,\n isScalarType,\n isUnionType,\n} from 'graphql';\nimport { ReactNode, useCallback, useEffect, useMemo, useState } from 'react';\nimport { useSchemaContext } from '../schema';\nimport { createContextHook, createNullableContext } from '../utility/context';\n\nexport type ExplorerFieldDef =\n | GraphQLField<{}, {}, {}>\n | GraphQLInputField\n | GraphQLArgument;\n\nexport type ExplorerNavStackItem = {\n /**\n * The name of the item.\n */\n name: string;\n /**\n * The definition object of the item, this can be a named type, a field, an\n * input field or an argument.\n */\n def?: GraphQLNamedType | ExplorerFieldDef;\n};\n\n// There's always at least one item in the nav stack\nexport type ExplorerNavStack = [\n ExplorerNavStackItem,\n ...ExplorerNavStackItem[],\n];\n\nconst initialNavStackItem: ExplorerNavStackItem = { name: 'Docs' };\n\nexport type ExplorerContextType = {\n /**\n * A stack of navigation items. The last item in the list is the current one.\n * This list always contains at least one item.\n */\n explorerNavStack: ExplorerNavStack;\n /**\n * Push an item to the navigation stack.\n * @param item The item that should be pushed to the stack.\n */\n push(item: ExplorerNavStackItem): void;\n /**\n * Pop the last item from the navigation stack.\n */\n pop(): void;\n /**\n * Reset the navigation stack to its initial state, this will remove all but\n * the initial stack item.\n */\n reset(): void;\n};\n\nexport const ExplorerContext =\n createNullableContext('ExplorerContext');\n\nexport type ExplorerContextProviderProps = {\n children: ReactNode;\n};\n\nexport function ExplorerContextProvider(props: ExplorerContextProviderProps) {\n const { schema, validationErrors } = useSchemaContext({\n nonNull: true,\n caller: ExplorerContextProvider,\n });\n\n const [navStack, setNavStack] = useState([\n initialNavStackItem,\n ]);\n\n const push = useCallback((item: ExplorerNavStackItem) => {\n setNavStack(currentState => {\n const lastItem = currentState.at(-1)!;\n return lastItem.def === item.def\n ? // Avoid pushing duplicate items\n currentState\n : [...currentState, item];\n });\n }, []);\n\n const pop = useCallback(() => {\n setNavStack(currentState =>\n currentState.length > 1\n ? (currentState.slice(0, -1) as ExplorerNavStack)\n : currentState,\n );\n }, []);\n\n const reset = useCallback(() => {\n setNavStack(currentState =>\n currentState.length === 1 ? currentState : [initialNavStackItem],\n );\n }, []);\n\n useEffect(() => {\n // Whenever the schema changes, we must revalidate/replace the nav stack.\n if (schema == null || validationErrors.length > 0) {\n reset();\n } else {\n // Replace the nav stack with an updated version using the new schema\n setNavStack(oldNavStack => {\n if (oldNavStack.length === 1) {\n return oldNavStack;\n }\n const newNavStack: ExplorerNavStack = [initialNavStackItem];\n let lastEntity: GraphQLNamedType | GraphQLField | null =\n null;\n for (const item of oldNavStack) {\n if (item === initialNavStackItem) {\n // No need to copy the initial item\n continue;\n }\n if (item.def) {\n // If item.def isn't a named type, it must be a field, inputField, or argument\n if (isNamedType(item.def)) {\n // The type needs to be replaced with the new schema type of the same name\n const newType = schema.getType(item.def.name);\n if (newType) {\n newNavStack.push({\n name: item.name,\n def: newType,\n });\n lastEntity = newType;\n } else {\n // This type no longer exists; the stack cannot be built beyond here\n break;\n }\n } else if (lastEntity === null) {\n // We can't have a sub-entity if we have no entity; stop rebuilding the nav stack\n break;\n } else if (\n isObjectType(lastEntity) ||\n isInputObjectType(lastEntity)\n ) {\n // item.def must be a Field / input field; replace with the new field of the same name\n const field = lastEntity.getFields()[item.name];\n if (field) {\n newNavStack.push({\n name: item.name,\n def: field,\n });\n } else {\n // This field no longer exists; the stack cannot be built beyond here\n break;\n }\n } else if (\n isScalarType(lastEntity) ||\n isEnumType(lastEntity) ||\n isInterfaceType(lastEntity) ||\n isUnionType(lastEntity)\n ) {\n // These don't (currently) have non-type sub-entries; something has gone wrong.\n // Handle gracefully by discontinuing rebuilding the stack.\n break;\n } else {\n // lastEntity must be a field (because it's not a named type)\n const field: GraphQLField = lastEntity;\n // Thus item.def must be an argument, so find the same named argument in the new schema\n const arg = field.args.find(a => a.name === item.name);\n if (arg) {\n newNavStack.push({\n name: item.name,\n def: field,\n });\n } else {\n // This argument no longer exists; the stack cannot be built beyond here\n break;\n }\n }\n } else {\n lastEntity = null;\n newNavStack.push(item);\n }\n }\n return newNavStack;\n });\n }\n }, [reset, schema, validationErrors]);\n\n const value = useMemo(\n () => ({ explorerNavStack: navStack, push, pop, reset }),\n [navStack, push, pop, reset],\n );\n\n return (\n \n {props.children}\n \n );\n}\n\nexport const useExplorerContext = createContextHook(ExplorerContext);\n","import {\n GraphQLNamedType,\n GraphQLType,\n isListType,\n isNonNullType,\n} from 'graphql';\n\nexport function renderType(\n type: GraphQLType,\n renderNamedType: (namedType: GraphQLNamedType) => JSX.Element,\n): JSX.Element {\n if (isNonNullType(type)) {\n return <>{renderType(type.ofType, renderNamedType)}!;\n }\n if (isListType(type)) {\n return <>[{renderType(type.ofType, renderNamedType)}];\n }\n return renderNamedType(type);\n}\n","import { GraphQLType } from 'graphql';\n\nimport { useExplorerContext } from '../context';\nimport { renderType } from './utils';\n\nimport './type-link.css';\n\ntype TypeLinkProps = {\n /**\n * The type that should be linked to.\n */\n type: GraphQLType;\n};\n\nexport function TypeLink(props: TypeLinkProps) {\n const { push } = useExplorerContext({ nonNull: true, caller: TypeLink });\n\n if (!props.type) {\n return null;\n }\n\n return renderType(props.type, namedType => (\n {\n event.preventDefault();\n push({ name: namedType.name, def: namedType });\n }}\n href=\"#\"\n >\n {namedType.name}\n
    \n ));\n}\n","import { GraphQLArgument } from 'graphql';\n\nimport { DefaultValue } from './default-value';\nimport { TypeLink } from './type-link';\n\nimport './argument.css';\nimport { MarkdownContent } from '../../ui';\n\ntype ArgumentProps = {\n /**\n * The argument that should be rendered.\n */\n arg: GraphQLArgument;\n /**\n * Toggle if the default value for the argument is shown (if there is one)\n * @default false\n */\n showDefaultValue?: boolean;\n /**\n * Toggle whether to render the whole argument including description and\n * deprecation reason (`false`) or to just render the argument name, type,\n * and default value in a single line (`true`).\n * @default false\n */\n inline?: boolean;\n};\n\nexport function Argument({ arg, showDefaultValue, inline }: ArgumentProps) {\n const definition = (\n \n {arg.name}\n {': '}\n \n {showDefaultValue !== false && }\n \n );\n if (inline) {\n return definition;\n }\n return (\n
    \n {definition}\n {arg.description ? (\n {arg.description}\n ) : null}\n {arg.deprecationReason ? (\n
    \n
    \n Deprecated\n
    \n \n {arg.deprecationReason}\n \n
    \n ) : null}\n
    \n );\n}\n","import { MarkdownContent } from '../../ui';\n\nimport './deprecation-reason.css';\n\ntype DeprecationReasonProps = {\n /**\n * The deprecation reason as markdown string.\n */\n children?: string | null;\n};\n\nexport function DeprecationReason(props: DeprecationReasonProps) {\n return props.children ? (\n
    \n
    Deprecated
    \n \n {props.children}\n \n
    \n ) : null;\n}\n","import { DirectiveNode } from 'graphql';\n\nimport './directive.css';\n\ntype DirectiveProps = {\n /**\n * The directive that should be rendered.\n */\n directive: DirectiveNode;\n};\n\nexport function Directive({ directive }: DirectiveProps) {\n return (\n \n @{directive.name.value}\n \n );\n}\n","import { ComponentType, ReactNode } from 'react';\n\nimport {\n ArgumentIcon,\n DeprecatedArgumentIcon,\n DeprecatedEnumValueIcon,\n DeprecatedFieldIcon,\n DirectiveIcon,\n EnumValueIcon,\n FieldIcon,\n ImplementsIcon,\n RootTypeIcon,\n TypeIcon,\n} from '../../icons';\n\nimport './section.css';\n\ntype ExplorerSectionProps = {\n children: ReactNode;\n /**\n * The title of the section, which will also determine the icon rendered next\n * to the headline.\n */\n title:\n | 'Root Types'\n | 'Fields'\n | 'Deprecated Fields'\n | 'Type'\n | 'Arguments'\n | 'Deprecated Arguments'\n | 'Implements'\n | 'Implementations'\n | 'Possible Types'\n | 'Enum Values'\n | 'Deprecated Enum Values'\n | 'Directives';\n};\n\nexport function ExplorerSection(props: ExplorerSectionProps) {\n const Icon = TYPE_TO_ICON[props.title];\n return (\n
    \n
    \n \n {props.title}\n
    \n
    \n {props.children}\n
    \n
    \n );\n}\n\nconst TYPE_TO_ICON: Record = {\n Arguments: ArgumentIcon,\n 'Deprecated Arguments': DeprecatedArgumentIcon,\n 'Deprecated Enum Values': DeprecatedEnumValueIcon,\n 'Deprecated Fields': DeprecatedFieldIcon,\n Directives: DirectiveIcon,\n 'Enum Values': EnumValueIcon,\n Fields: FieldIcon,\n Implements: ImplementsIcon,\n Implementations: TypeIcon,\n 'Possible Types': TypeIcon,\n 'Root Types': RootTypeIcon,\n Type: TypeIcon,\n};\n","import { GraphQLArgument } from 'graphql';\nimport { useState } from 'react';\n\nimport { Button, MarkdownContent } from '../../ui';\nimport { ExplorerFieldDef } from '../context';\nimport { Argument } from './argument';\nimport { DeprecationReason } from './deprecation-reason';\nimport { Directive } from './directive';\nimport { ExplorerSection } from './section';\nimport { TypeLink } from './type-link';\n\ntype FieldDocumentationProps = {\n /**\n * The field or argument that should be rendered.\n */\n field: ExplorerFieldDef;\n};\n\nexport function FieldDocumentation(props: FieldDocumentationProps) {\n return (\n <>\n {props.field.description ? (\n \n {props.field.description}\n \n ) : null}\n {props.field.deprecationReason}\n \n \n \n \n \n \n );\n}\n\nfunction Arguments({ field }: { field: ExplorerFieldDef }) {\n const [showDeprecated, setShowDeprecated] = useState(false);\n\n if (!('args' in field)) {\n return null;\n }\n\n const args: GraphQLArgument[] = [];\n const deprecatedArgs: GraphQLArgument[] = [];\n for (const argument of field.args) {\n if (argument.deprecationReason) {\n deprecatedArgs.push(argument);\n } else {\n args.push(argument);\n }\n }\n\n return (\n <>\n {args.length > 0 ? (\n \n {args.map(arg => (\n \n ))}\n \n ) : null}\n {deprecatedArgs.length > 0 ? (\n showDeprecated || args.length === 0 ? (\n \n {deprecatedArgs.map(arg => (\n \n ))}\n \n ) : (\n {\n setShowDeprecated(true);\n }}\n >\n Show Deprecated Arguments\n \n )\n ) : null}\n \n );\n}\n\nfunction Directives({ field }: { field: ExplorerFieldDef }) {\n const directives = field.astNode?.directives || [];\n if (!directives || directives.length === 0) {\n return null;\n }\n return (\n \n {directives.map(directive => (\n
    \n \n
    \n ))}\n
    \n );\n}\n","import type { GraphQLSchema } from 'graphql';\n\nimport { MarkdownContent } from '../../ui';\nimport { ExplorerSection } from './section';\nimport { TypeLink } from './type-link';\n\nimport './schema-documentation.css';\n\ntype SchemaDocumentationProps = {\n /**\n * The schema that should be rendered.\n */\n schema: GraphQLSchema;\n};\n\nexport function SchemaDocumentation(props: SchemaDocumentationProps) {\n const queryType = props.schema.getQueryType();\n const mutationType = props.schema.getMutationType?.();\n const subscriptionType = props.schema.getSubscriptionType?.();\n\n return (\n <>\n \n {props.schema.description ||\n 'A GraphQL schema provides a root type for each kind of operation.'}\n \n \n {queryType ? (\n
    \n query\n {': '}\n \n
    \n ) : null}\n {mutationType && (\n
    \n mutation\n {': '}\n \n
    \n )}\n {subscriptionType && (\n
    \n \n subscription\n \n {': '}\n \n
    \n )}\n
    \n \n );\n}\n","import { useRef, useEffect } from 'react';\n\n/**\n * Call an effect after a component update, skipping the initial mount.\n *\n * @param effect Effect to call\n * @param deps Effect dependency list\n */\nfunction useUpdateEffect(effect, deps) {\n var mounted = useRef(false);\n useEffect(function () {\n if (mounted.current) {\n effect();\n } else {\n mounted.current = true;\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, deps);\n}\n\nexport { useUpdateEffect };\n","import { forwardRef, useRef, createElement, useContext, useEffect, useCallback, useMemo, Fragment, useState, useReducer } from 'react';\nimport PropTypes from 'prop-types';\nimport { useIsomorphicLayoutEffect } from '@reach/utils/use-isomorphic-layout-effect';\nimport { createNamedContext } from '@reach/utils/context';\nimport { isFunction } from '@reach/utils/type-check';\nimport { makeId } from '@reach/utils/make-id';\nimport { noop } from '@reach/utils/noop';\nimport { useCheckStyles } from '@reach/utils/dev-utils';\nimport { useComposedRefs } from '@reach/utils/compose-refs';\nimport { useUpdateEffect } from '@reach/utils/use-update-effect';\nimport { useStatefulRefValue } from '@reach/utils/use-stateful-ref-value';\nimport { composeEventHandlers } from '@reach/utils/compose-event-handlers';\nimport { createDescendantContext, useDescendantsInit, DescendantProvider, useDescendant, useDescendants } from '@reach/descendants';\nimport { useId } from '@reach/auto-id';\nimport { Popover, positionMatchWidth } from '@reach/popover';\nimport warning from 'tiny-warning';\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\n// Forked from https://github.com/bvaughn/highlight-words-core\n\n/**\n * Creates an array of chunk objects representing both higlightable and non\n * highlightable pieces of text that match each search word.\n *\n * @return Array of \"chunk\" objects\n */\nfunction findAll(_ref) {\n var autoEscape = _ref.autoEscape,\n _ref$caseSensitive = _ref.caseSensitive,\n caseSensitive = _ref$caseSensitive === void 0 ? false : _ref$caseSensitive,\n _ref$findChunks = _ref.findChunks,\n findChunks = _ref$findChunks === void 0 ? defaultFindChunks : _ref$findChunks,\n sanitize = _ref.sanitize,\n searchWords = _ref.searchWords,\n textToHighlight = _ref.textToHighlight;\n return fillInChunks({\n chunksToHighlight: combineChunks({\n chunks: findChunks({\n autoEscape: autoEscape,\n caseSensitive: caseSensitive,\n sanitize: sanitize,\n searchWords: searchWords,\n textToHighlight: textToHighlight\n })\n }),\n totalLength: textToHighlight ? textToHighlight.length : 0\n });\n}\n/**\n * Takes an array of \"chunk\" objects and combines chunks that overlap into\n * single chunks.\n *\n * @return Array of \"chunk\" objects\n */\n\n\nfunction combineChunks(_ref2) {\n var chunks = _ref2.chunks;\n return chunks.sort(function (first, second) {\n return first.start - second.start;\n }).reduce(function (processedChunks, nextChunk) {\n // First chunk just goes straight in the array...\n if (processedChunks.length === 0) {\n return [nextChunk];\n } else {\n // ... subsequent chunks get checked to see if they overlap...\n var prevChunk = processedChunks.pop();\n\n if (nextChunk.start <= prevChunk.end) {\n // It may be the case that prevChunk completely surrounds nextChunk, so take the\n // largest of the end indeces.\n var endIndex = Math.max(prevChunk.end, nextChunk.end);\n processedChunks.push({\n highlight: false,\n start: prevChunk.start,\n end: endIndex\n });\n } else {\n processedChunks.push(prevChunk, nextChunk);\n }\n\n return processedChunks;\n }\n }, []);\n}\n/**\n * Examine text for any matches. If we find matches, add them to the returned\n * array as a \"chunk\" object.\n *\n * @return Array of \"chunk\" objects\n */\n\n\nfunction defaultFindChunks(_ref3) {\n var autoEscape = _ref3.autoEscape,\n caseSensitive = _ref3.caseSensitive,\n _ref3$sanitize = _ref3.sanitize,\n sanitize = _ref3$sanitize === void 0 ? defaultSanitize : _ref3$sanitize,\n searchWords = _ref3.searchWords,\n textToHighlight = _ref3.textToHighlight;\n textToHighlight = sanitize(textToHighlight || \"\");\n return searchWords.filter(function (searchWord) {\n return searchWord;\n }) // Remove empty words\n .reduce(function (chunks, searchWord) {\n searchWord = sanitize(searchWord);\n\n if (autoEscape) {\n searchWord = escapeRegExpFn(searchWord);\n }\n\n var regex = new RegExp(searchWord, caseSensitive ? \"g\" : \"gi\");\n var match;\n\n while (match = regex.exec(textToHighlight || \"\")) {\n var start = match.index;\n var end = regex.lastIndex; // We do not return zero-length matches\n\n if (end > start) {\n chunks.push({\n highlight: false,\n start: start,\n end: end\n });\n } // Prevent browsers like Firefox from getting stuck in an infinite loop\n // See http://www.regexguru.com/2008/04/watch-out-for-zero-length-matches/\n\n\n if (match.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n }\n\n return chunks;\n }, []);\n}\n/**\n * Given a set of chunks to highlight, create an additional set of chunks\n * to represent the bits of text between the highlighted text.\n *\n * @return Array of \"chunk\" objects\n */\n\n\nfunction fillInChunks(_ref4) {\n var chunksToHighlight = _ref4.chunksToHighlight,\n totalLength = _ref4.totalLength;\n var allChunks = [];\n\n if (chunksToHighlight.length === 0) {\n append(0, totalLength, false);\n } else {\n var lastIndex = 0;\n chunksToHighlight.forEach(function (chunk) {\n append(lastIndex, chunk.start, false);\n append(chunk.start, chunk.end, true);\n lastIndex = chunk.end;\n });\n append(lastIndex, totalLength, false);\n }\n\n return allChunks;\n\n function append(start, end, highlight) {\n if (end - start > 0) {\n allChunks.push({\n start: start,\n end: end,\n highlight: highlight\n });\n }\n }\n}\n\nfunction defaultSanitize(string) {\n return string;\n}\n\nfunction escapeRegExpFn(string) {\n return string.replace(/[-[\\]/{}()*+?.\\\\^$|]/g, \"\\\\$&\");\n}\n\nvar HighlightWords = {\n combineChunks: combineChunks,\n fillInChunks: fillInChunks,\n findAll: findAll,\n findChunks: defaultFindChunks\n};\n\nvar _excluded = [\"onSelect\", \"openOnFocus\", \"children\", \"as\", \"aria-label\", \"aria-labelledby\"],\n _excluded2 = [\"as\", \"selectOnClick\", \"autocomplete\", \"onClick\", \"onChange\", \"onKeyDown\", \"onBlur\", \"onFocus\", \"value\"],\n _excluded3 = [\"as\", \"children\", \"portal\", \"onKeyDown\", \"onBlur\", \"position\"],\n _excluded4 = [\"persistSelection\", \"as\"],\n _excluded5 = [\"as\", \"children\", \"index\", \"value\", \"onClick\"],\n _excluded6 = [\"as\", \"onClick\", \"onKeyDown\"];\n\nvar _on, _on2, _on3, _on4, _states;\n// States\n// Nothing going on, waiting for the user to type or use the arrow keys\n\nvar IDLE = \"IDLE\"; // The component is suggesting options as the user types\n\nvar SUGGESTING = \"SUGGESTING\"; // The user is using the keyboard to navigate the list, not typing\n\nvar NAVIGATING = \"NAVIGATING\"; // The user is interacting with arbitrary elements inside the popup that\n// are not ComboboxInputs\n\nvar INTERACTING = \"INTERACTING\"; ////////////////////////////////////////////////////////////////////////////////\n// Events\n// User cleared the value w/ backspace, but input still has focus\n\nvar CLEAR = \"CLEAR\"; // User is typing\n\nvar CHANGE = \"CHANGE\"; // Initial input value change handler for syncing user state with state machine\n// Prevents initial change from sending the user to the NAVIGATING state\n// https://github.com/reach/reach-ui/issues/464\n\nvar INITIAL_CHANGE = \"INITIAL_CHANGE\"; // User is navigating w/ the keyboard\n\nvar NAVIGATE = \"NAVIGATE\"; // User can be navigating with keyboard and then click instead, we want the\n// value from the click, not the current nav item\n\nvar SELECT_WITH_KEYBOARD = \"SELECT_WITH_KEYBOARD\";\nvar SELECT_WITH_CLICK = \"SELECT_WITH_CLICK\"; // Pretty self-explanatory, user can hit escape or blur to close the popover\n\nvar ESCAPE = \"ESCAPE\";\nvar BLUR = \"BLUR\"; // The user left the input to interact with arbitrary elements inside the popup\n\nvar INTERACT = \"INTERACT\";\nvar FOCUS = \"FOCUS\";\nvar OPEN_WITH_BUTTON = \"OPEN_WITH_BUTTON\";\nvar OPEN_WITH_INPUT_CLICK = \"OPEN_WITH_INPUT_CLICK\";\nvar CLOSE_WITH_BUTTON = \"CLOSE_WITH_BUTTON\"; ////////////////////////////////////////////////////////////////////////////////\n\nvar stateChart = {\n initial: IDLE,\n states: (_states = {}, _states[IDLE] = {\n on: (_on = {}, _on[BLUR] = IDLE, _on[CLEAR] = IDLE, _on[CHANGE] = SUGGESTING, _on[INITIAL_CHANGE] = IDLE, _on[FOCUS] = SUGGESTING, _on[NAVIGATE] = NAVIGATING, _on[OPEN_WITH_BUTTON] = SUGGESTING, _on[OPEN_WITH_INPUT_CLICK] = SUGGESTING, _on)\n }, _states[SUGGESTING] = {\n on: (_on2 = {}, _on2[CHANGE] = SUGGESTING, _on2[FOCUS] = SUGGESTING, _on2[NAVIGATE] = NAVIGATING, _on2[CLEAR] = IDLE, _on2[ESCAPE] = IDLE, _on2[BLUR] = IDLE, _on2[SELECT_WITH_CLICK] = IDLE, _on2[INTERACT] = INTERACTING, _on2[CLOSE_WITH_BUTTON] = IDLE, _on2)\n }, _states[NAVIGATING] = {\n on: (_on3 = {}, _on3[CHANGE] = SUGGESTING, _on3[FOCUS] = SUGGESTING, _on3[CLEAR] = IDLE, _on3[BLUR] = IDLE, _on3[ESCAPE] = IDLE, _on3[NAVIGATE] = NAVIGATING, _on3[SELECT_WITH_CLICK] = IDLE, _on3[SELECT_WITH_KEYBOARD] = IDLE, _on3[CLOSE_WITH_BUTTON] = IDLE, _on3[INTERACT] = INTERACTING, _on3)\n }, _states[INTERACTING] = {\n on: (_on4 = {}, _on4[CLEAR] = IDLE, _on4[CHANGE] = SUGGESTING, _on4[FOCUS] = SUGGESTING, _on4[BLUR] = IDLE, _on4[ESCAPE] = IDLE, _on4[NAVIGATE] = NAVIGATING, _on4[CLOSE_WITH_BUTTON] = IDLE, _on4[SELECT_WITH_CLICK] = IDLE, _on4)\n }, _states)\n};\n\nvar reducer = function reducer(data, event) {\n var nextState = _extends({}, data, {\n lastEventType: event.type\n });\n\n switch (event.type) {\n case CHANGE:\n case INITIAL_CHANGE:\n return _extends({}, nextState, {\n navigationValue: null,\n value: event.value\n });\n\n case NAVIGATE:\n case OPEN_WITH_BUTTON:\n case OPEN_WITH_INPUT_CLICK:\n return _extends({}, nextState, {\n navigationValue: findNavigationValue(nextState, event)\n });\n\n case CLEAR:\n return _extends({}, nextState, {\n value: \"\",\n navigationValue: null\n });\n\n case BLUR:\n case ESCAPE:\n return _extends({}, nextState, {\n navigationValue: null\n });\n\n case SELECT_WITH_CLICK:\n return _extends({}, nextState, {\n // if controlled, \"set\" the input to what it already has, and let the\n // user do whatever they want\n value: event.isControlled ? data.value : event.value,\n navigationValue: null\n });\n\n case SELECT_WITH_KEYBOARD:\n return _extends({}, nextState, {\n // if controlled, \"set\" the input to what it already has, and let the\n // user do whatever they want\n value: event.isControlled ? data.value : data.navigationValue,\n navigationValue: null\n });\n\n case CLOSE_WITH_BUTTON:\n return _extends({}, nextState, {\n navigationValue: null\n });\n\n case INTERACT:\n return nextState;\n\n case FOCUS:\n return _extends({}, nextState, {\n navigationValue: findNavigationValue(nextState, event)\n });\n\n default:\n return nextState;\n }\n};\n\nfunction popoverIsExpanded(state) {\n return [SUGGESTING, NAVIGATING, INTERACTING].includes(state);\n}\n/**\n * When we open a list, set the navigation value to the value in the input, if\n * it's in the list, then it'll automatically be highlighted.\n *\n * @param stateData\n * @param event\n */\n\n\nfunction findNavigationValue(stateData, event) {\n // @ts-ignore\n if (event.value) {\n // @ts-ignore\n return event.value; // @ts-ignore\n } else if (event.persistSelection) {\n return stateData.value;\n } else {\n return null;\n }\n}\n\nvar ComboboxDescendantContext = /*#__PURE__*/createDescendantContext(\"ComboboxDescendantContext\");\nvar ComboboxContext = /*#__PURE__*/createNamedContext(\"ComboboxContext\", {}); // Allows us to put the option's value on context so that ComboboxOptionText\n// can work it's highlight text magic no matter what else is rendered around\n// it.\n\nvar OptionContext = /*#__PURE__*/createNamedContext(\"OptionContext\", {}); ////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Combobox\n *\n * @see Docs https://reach.tech/combobox#combobox\n */\n\nvar Combobox = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {\n var _data$navigationValue;\n\n var onSelect = _ref.onSelect,\n _ref$openOnFocus = _ref.openOnFocus,\n openOnFocus = _ref$openOnFocus === void 0 ? false : _ref$openOnFocus,\n children = _ref.children,\n _ref$as = _ref.as,\n Comp = _ref$as === void 0 ? \"div\" : _ref$as,\n ariaLabel = _ref[\"aria-label\"],\n ariaLabelledby = _ref[\"aria-labelledby\"],\n props = _objectWithoutPropertiesLoose(_ref, _excluded);\n\n var _useDescendantsInit = useDescendantsInit(),\n options = _useDescendantsInit[0],\n setOptions = _useDescendantsInit[1]; // Need this to focus it\n\n\n var inputRef = useRef();\n var popoverRef = useRef();\n var buttonRef = useRef(); // When we don't want cycle back to\n // the user's value while navigating (because it's always the user's value),\n // but we need to know this in useKeyDown which is far away from the prop\n // here, so we do something sneaky and write it to this ref on context so we\n // can use it anywhere else 😛. Another new trick for me and I'm excited\n // about this one too!\n\n var autocompletePropRef = useRef(false);\n var persistSelectionRef = useRef(false);\n var defaultData = {\n // The value the user has typed. We derive this also when the developer is\n // controlling the value of ComboboxInput.\n value: \"\",\n // the value the user has navigated to with the keyboard\n navigationValue: null\n };\n\n var _useReducerMachine = useReducerMachine(stateChart, reducer, defaultData),\n state = _useReducerMachine[0],\n data = _useReducerMachine[1],\n transition = _useReducerMachine[2];\n\n useFocusManagement(data.lastEventType, inputRef);\n var id = useId(props.id);\n var listboxId = id ? makeId(\"listbox\", id) : \"listbox\";\n var isControlledRef = useRef(false);\n var isExpanded = popoverIsExpanded(state);\n var context = {\n ariaLabel: ariaLabel,\n ariaLabelledby: ariaLabelledby,\n autocompletePropRef: autocompletePropRef,\n buttonRef: buttonRef,\n comboboxId: id,\n data: data,\n inputRef: inputRef,\n isExpanded: isExpanded,\n listboxId: listboxId,\n onSelect: onSelect || noop,\n openOnFocus: openOnFocus,\n persistSelectionRef: persistSelectionRef,\n popoverRef: popoverRef,\n state: state,\n transition: transition,\n isControlledRef: isControlledRef\n };\n useCheckStyles(\"combobox\");\n return /*#__PURE__*/createElement(DescendantProvider, {\n context: ComboboxDescendantContext,\n items: options,\n set: setOptions\n }, /*#__PURE__*/createElement(ComboboxContext.Provider, {\n value: context\n }, /*#__PURE__*/createElement(Comp, _extends({}, props, {\n \"data-reach-combobox\": \"\",\n \"data-state\": getDataState(state),\n \"data-expanded\": isExpanded || undefined,\n ref: forwardedRef\n }), isFunction(children) ? children({\n id: id,\n isExpanded: isExpanded,\n navigationValue: (_data$navigationValue = data.navigationValue) != null ? _data$navigationValue : null,\n state: state\n }) : children)));\n});\n/**\n * @see Docs https://reach.tech/combobox#combobox-props\n */\n\nif (process.env.NODE_ENV !== \"production\") {\n Combobox.displayName = \"Combobox\";\n Combobox.propTypes = {\n as: PropTypes.any,\n onSelect: PropTypes.func,\n openOnFocus: PropTypes.bool\n };\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\n * ComboboxInput\n *\n * Wraps an `` with a couple extra props that work with the combobox.\n *\n * @see Docs https://reach.tech/combobox#comboboxinput\n */\n\n\nvar ComboboxInput = /*#__PURE__*/forwardRef(function (_ref2, forwardedRef) {\n var _ref2$as = _ref2.as,\n Comp = _ref2$as === void 0 ? \"input\" : _ref2$as,\n _ref2$selectOnClick = _ref2.selectOnClick,\n selectOnClick = _ref2$selectOnClick === void 0 ? false : _ref2$selectOnClick,\n _ref2$autocomplete = _ref2.autocomplete,\n autocomplete = _ref2$autocomplete === void 0 ? true : _ref2$autocomplete,\n onClick = _ref2.onClick,\n onChange = _ref2.onChange,\n onKeyDown = _ref2.onKeyDown,\n onBlur = _ref2.onBlur,\n onFocus = _ref2.onFocus,\n controlledValue = _ref2.value,\n props = _objectWithoutPropertiesLoose(_ref2, _excluded2);\n\n // https://github.com/reach/reach-ui/issues/464\n var _React$useRef = useRef(controlledValue),\n initialControlledValue = _React$useRef.current;\n\n var controlledValueChangedRef = useRef(false);\n useUpdateEffect(function () {\n controlledValueChangedRef.current = true;\n }, [controlledValue]);\n\n var _React$useContext = useContext(ComboboxContext),\n _React$useContext$dat = _React$useContext.data,\n navigationValue = _React$useContext$dat.navigationValue,\n value = _React$useContext$dat.value,\n lastEventType = _React$useContext$dat.lastEventType,\n inputRef = _React$useContext.inputRef,\n state = _React$useContext.state,\n transition = _React$useContext.transition,\n listboxId = _React$useContext.listboxId,\n autocompletePropRef = _React$useContext.autocompletePropRef,\n openOnFocus = _React$useContext.openOnFocus,\n isExpanded = _React$useContext.isExpanded,\n ariaLabel = _React$useContext.ariaLabel,\n ariaLabelledby = _React$useContext.ariaLabelledby,\n persistSelectionRef = _React$useContext.persistSelectionRef,\n isControlledRef = _React$useContext.isControlledRef;\n\n var ref = useComposedRefs(inputRef, forwardedRef); // Because we close the List on blur, we need to track if the blur is\n // caused by clicking inside the list, and if so, don't close the List.\n\n var selectOnClickRef = useRef(false);\n var handleKeyDown = useKeyDown();\n var handleBlur = useBlur();\n var isControlled = typeof controlledValue !== \"undefined\";\n var wasInitiallyControlled = typeof initialControlledValue !== \"undefined\";\n\n if (process.env.NODE_ENV !== \"production\") {\n process.env.NODE_ENV !== \"production\" ? warning(!(!isControlled && wasInitiallyControlled), \"ComboboxInput is changing from controlled to uncontrolled. ComboboxInput should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled ComboboxInput for the lifetime of the component. Check the `value` prop being passed in.\") : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!(isControlled && !wasInitiallyControlled), \"ComboboxInput is changing from uncontrolled to controlled. ComboboxInput should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled ComboboxInput for the lifetime of the component. Check the `value` prop being passed in.\") : void 0;\n }\n\n useEffect(function () {\n isControlledRef.current = isControlled; // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isControlled]); // Layout effect should be SSR-safe here because we don't actually do\n // anything with this ref that involves rendering until after we've\n // let the client hydrate in nested components.\n\n useIsomorphicLayoutEffect(function () {\n autocompletePropRef.current = autocomplete;\n }, [autocomplete, autocompletePropRef]);\n var handleValueChange = useCallback(function (value) {\n if (value.trim() === \"\") {\n transition(CLEAR, {\n isControlled: isControlled\n });\n } else if (value === initialControlledValue && !controlledValueChangedRef.current) {\n transition(INITIAL_CHANGE, {\n value: value\n });\n } else {\n transition(CHANGE, {\n value: value\n });\n }\n }, [initialControlledValue, transition, isControlled]);\n useEffect(function () {\n // If they are controlling the value we still need to do our transitions,\n // so we have this derived state to emulate onChange of the input as we\n // receive new `value`s ...[*]\n if (isControlled && controlledValue !== value && ( // https://github.com/reach/reach-ui/issues/481\n controlledValue.trim() === \"\" ? (value || \"\").trim() !== \"\" : true)) {\n handleValueChange(controlledValue);\n }\n }, [controlledValue, handleValueChange, isControlled, value]); // [*]... and when controlled, we don't trigger handleValueChange as the\n // user types, instead the developer controls it with the normal input\n // onChange prop\n\n function handleChange(event) {\n var value = event.target.value;\n\n if (!isControlled) {\n handleValueChange(value);\n }\n }\n\n function handleFocus() {\n if (selectOnClick) {\n selectOnClickRef.current = true;\n } // If we select an option with click, useFocusManagement will focus the\n // input, in those cases we don't want to cause the menu to open back up,\n // so we guard behind these states.\n\n\n if (openOnFocus && lastEventType !== SELECT_WITH_CLICK) {\n transition(FOCUS, {\n persistSelection: persistSelectionRef.current\n });\n }\n }\n\n function handleClick() {\n if (selectOnClickRef.current) {\n var _inputRef$current;\n\n selectOnClickRef.current = false;\n (_inputRef$current = inputRef.current) == null ? void 0 : _inputRef$current.select();\n }\n\n if (openOnFocus && state === IDLE) {\n transition(OPEN_WITH_INPUT_CLICK);\n }\n }\n\n var inputValue = autocomplete && (state === NAVIGATING || state === INTERACTING) ? // When idle, we don't have a navigationValue on ArrowUp/Down\n navigationValue || controlledValue || value : controlledValue || value;\n return /*#__PURE__*/createElement(Comp, _extends({\n \"aria-activedescendant\": navigationValue ? String(makeHash(navigationValue)) : undefined,\n \"aria-autocomplete\": \"both\",\n \"aria-controls\": listboxId,\n \"aria-expanded\": isExpanded,\n \"aria-haspopup\": \"listbox\",\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabel ? undefined : ariaLabelledby,\n role: \"combobox\"\n }, props, {\n \"data-reach-combobox-input\": \"\",\n \"data-state\": getDataState(state),\n ref: ref,\n onBlur: composeEventHandlers(onBlur, handleBlur),\n onChange: composeEventHandlers(onChange, handleChange),\n onClick: composeEventHandlers(onClick, handleClick),\n onFocus: composeEventHandlers(onFocus, handleFocus),\n onKeyDown: composeEventHandlers(onKeyDown, handleKeyDown),\n value: inputValue || \"\"\n }));\n});\n/**\n * @see Docs https://reach.tech/combobox#comboboxinput-props\n */\n\nif (process.env.NODE_ENV !== \"production\") {\n ComboboxInput.displayName = \"ComboboxInput\";\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\n * ComboboxPopover\n *\n * Contains the popup that renders the list. Because some UI needs to render\n * more than the list in the popup, you need to render one of these around the\n * list. For example, maybe you want to render the number of results suggested.\n *\n * @see Docs https://reach.tech/combobox#comboboxpopover\n */\n\n\nvar ComboboxPopover = /*#__PURE__*/forwardRef(function (_ref3, forwardedRef) {\n var _ref3$as = _ref3.as,\n Comp = _ref3$as === void 0 ? \"div\" : _ref3$as,\n children = _ref3.children,\n _ref3$portal = _ref3.portal,\n portal = _ref3$portal === void 0 ? true : _ref3$portal,\n onKeyDown = _ref3.onKeyDown,\n onBlur = _ref3.onBlur,\n _ref3$position = _ref3.position,\n position = _ref3$position === void 0 ? positionMatchWidth : _ref3$position,\n props = _objectWithoutPropertiesLoose(_ref3, _excluded3);\n\n var _React$useContext2 = useContext(ComboboxContext),\n popoverRef = _React$useContext2.popoverRef,\n inputRef = _React$useContext2.inputRef,\n isExpanded = _React$useContext2.isExpanded,\n state = _React$useContext2.state;\n\n var ref = useComposedRefs(popoverRef, forwardedRef);\n var handleKeyDown = useKeyDown();\n var handleBlur = useBlur();\n var sharedProps = {\n \"data-reach-combobox-popover\": \"\",\n \"data-state\": getDataState(state),\n onKeyDown: composeEventHandlers(onKeyDown, handleKeyDown),\n onBlur: composeEventHandlers(onBlur, handleBlur),\n // Instead of conditionally rendering the popover we use the `hidden` prop\n // because we don't want to unmount on close (from escape or onSelect).\n // However, the developer can conditionally render the ComboboxPopover if\n // they do want to cause mount/unmount based on the app's own data (like\n // results.length or whatever).\n hidden: !isExpanded,\n tabIndex: -1,\n children: children\n };\n return portal ? /*#__PURE__*/createElement(Popover, _extends({\n as: Comp\n }, props, {\n ref: ref,\n \"data-expanded\": isExpanded || undefined,\n position: position,\n targetRef: inputRef,\n unstable_skipInitialPortalRender: true\n }, sharedProps)) : /*#__PURE__*/createElement(Comp, _extends({\n ref: ref\n }, props, sharedProps));\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n ComboboxPopover.displayName = \"ComboboxPopover\";\n}\n/**\n * @see Docs https://reach.tech/combobox#comboboxpopover-props\n */\n\n\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * ComboboxList\n *\n * Contains the `ComboboxOption` elements and sets up the proper aria attributes\n * for the list.\n *\n * @see Docs https://reach.tech/combobox#comboboxlist\n */\nvar ComboboxList = /*#__PURE__*/forwardRef(function (_ref4, forwardedRef) {\n var _ref4$persistSelectio = _ref4.persistSelection,\n persistSelection = _ref4$persistSelectio === void 0 ? false : _ref4$persistSelectio,\n _ref4$as = _ref4.as,\n Comp = _ref4$as === void 0 ? \"ul\" : _ref4$as,\n props = _objectWithoutPropertiesLoose(_ref4, _excluded4);\n\n var _React$useContext3 = useContext(ComboboxContext),\n persistSelectionRef = _React$useContext3.persistSelectionRef,\n listboxId = _React$useContext3.listboxId;\n\n if (persistSelection) {\n persistSelectionRef.current = true;\n }\n\n return /*#__PURE__*/createElement(Comp, _extends({\n role: \"listbox\"\n }, props, {\n ref: forwardedRef,\n \"data-reach-combobox-list\": \"\",\n id: listboxId\n }));\n});\n/**\n * @see Docs https://reach.tech/combobox#comboboxlist-props\n */\n\nif (process.env.NODE_ENV !== \"production\") {\n ComboboxList.displayName = \"ComboboxList\";\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\n * ComboboxOption\n *\n * An option that is suggested to the user as they interact with the combobox.\n *\n * @see Docs https://reach.tech/combobox#comboboxoption\n */\n\n\nvar ComboboxOption = /*#__PURE__*/forwardRef(function (_ref5, forwardedRef) {\n var _ref5$as = _ref5.as,\n Comp = _ref5$as === void 0 ? \"li\" : _ref5$as,\n children = _ref5.children,\n indexProp = _ref5.index,\n value = _ref5.value,\n onClick = _ref5.onClick,\n props = _objectWithoutPropertiesLoose(_ref5, _excluded5);\n\n var _React$useContext4 = useContext(ComboboxContext),\n onSelect = _React$useContext4.onSelect,\n navigationValue = _React$useContext4.data.navigationValue,\n transition = _React$useContext4.transition,\n isControlledRef = _React$useContext4.isControlledRef;\n\n var ownRef = useRef(null);\n\n var _useStatefulRefValue = useStatefulRefValue(ownRef, null),\n element = _useStatefulRefValue[0],\n handleRefSet = _useStatefulRefValue[1];\n\n var descendant = useMemo(function () {\n return {\n element: element,\n value: value\n };\n }, [value, element]);\n var index = useDescendant(descendant, ComboboxDescendantContext, indexProp);\n var ref = useComposedRefs(forwardedRef, handleRefSet);\n var isActive = navigationValue === value;\n\n var handleClick = function handleClick() {\n onSelect && onSelect(value);\n transition(SELECT_WITH_CLICK, {\n value: value,\n isControlled: isControlledRef.current\n });\n };\n\n return /*#__PURE__*/createElement(OptionContext.Provider, {\n value: {\n value: value,\n index: index\n }\n }, /*#__PURE__*/createElement(Comp, _extends({\n \"aria-selected\": isActive,\n role: \"option\"\n }, props, {\n \"data-reach-combobox-option\": \"\",\n ref: ref,\n id: String(makeHash(value)),\n \"data-highlighted\": isActive ? \"\" : undefined // Without this the menu will close from `onBlur`, but with it the\n // element can be `document.activeElement` and then our focus checks in\n // onBlur will work as intended\n ,\n tabIndex: -1,\n onClick: composeEventHandlers(onClick, handleClick)\n }), children ? isFunction(children) ? children({\n value: value,\n index: index\n }) : children : /*#__PURE__*/createElement(ComboboxOptionText, null)));\n});\n/**\n * @see Docs https://reach.tech/combobox#comboboxoption-props\n */\n\nif (process.env.NODE_ENV !== \"production\") {\n ComboboxOption.displayName = \"ComboboxOption\";\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\n * ComboboxOptionText\n *\n * Renders the value of a `ComboboxOption` as text but with spans wrapping the\n * matching and non-matching segments of text.\n *\n * We don't forwardRef or spread props because we render multiple spans or null,\n * should be fine 🤙\n *\n * @example\n * \n * 🌧 \n * \n *\n * @see Docs https://reach.tech/combobox#comboboxoptiontext\n */\n\n\nfunction ComboboxOptionText() {\n var _React$useContext5 = useContext(OptionContext),\n value = _React$useContext5.value;\n\n var _React$useContext6 = useContext(ComboboxContext),\n contextValue = _React$useContext6.data.value;\n\n var results = useMemo(function () {\n return HighlightWords.findAll({\n searchWords: escapeRegexp(contextValue || \"\").split(/\\s+/),\n textToHighlight: value\n });\n }, [contextValue, value]);\n return /*#__PURE__*/createElement(Fragment, null, results.length ? results.map(function (result, index) {\n var str = value.slice(result.start, result.end);\n return /*#__PURE__*/createElement(\"span\", {\n key: index,\n \"data-reach-combobox-option-text\": \"\",\n \"data-user-value\": result.highlight ? true : undefined,\n \"data-suggested-value\": result.highlight ? undefined : true\n }, str);\n }) : value);\n}\n\nif (process.env.NODE_ENV !== \"production\") {\n ComboboxOptionText.displayName = \"ComboboxOptionText\";\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\n * ComboboxButton\n */\n\n\nvar ComboboxButton = /*#__PURE__*/forwardRef(function (_ref6, forwardedRef) {\n var _ref6$as = _ref6.as,\n Comp = _ref6$as === void 0 ? \"button\" : _ref6$as,\n onClick = _ref6.onClick,\n onKeyDown = _ref6.onKeyDown,\n props = _objectWithoutPropertiesLoose(_ref6, _excluded6);\n\n var _React$useContext7 = useContext(ComboboxContext),\n transition = _React$useContext7.transition,\n state = _React$useContext7.state,\n buttonRef = _React$useContext7.buttonRef,\n listboxId = _React$useContext7.listboxId,\n isExpanded = _React$useContext7.isExpanded;\n\n var ref = useComposedRefs(buttonRef, forwardedRef);\n var handleKeyDown = useKeyDown();\n\n var handleClick = function handleClick() {\n if (state === IDLE) {\n transition(OPEN_WITH_BUTTON);\n } else {\n transition(CLOSE_WITH_BUTTON);\n }\n };\n\n return /*#__PURE__*/createElement(Comp, _extends({\n \"aria-controls\": listboxId,\n \"aria-haspopup\": \"listbox\",\n \"aria-expanded\": isExpanded\n }, props, {\n \"data-reach-combobox-button\": \"\",\n ref: ref,\n onClick: composeEventHandlers(onClick, handleClick),\n onKeyDown: composeEventHandlers(onKeyDown, handleKeyDown)\n }));\n});\n\nif (process.env.NODE_ENV !== \"production\") {\n ComboboxButton.displayName = \"ComboboxButton\";\n} ////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Move focus back to the input if we start navigating w/ the\n * keyboard after focus has moved to any focusable content in\n * the popup.\n *\n * @param lastEventType\n * @param inputRef\n */\n\n\nfunction useFocusManagement(lastEventType, inputRef) {\n // useLayoutEffect so that the cursor goes to the end of the input instead\n // of awkwardly at the beginning, unclear to me why 🤷‍♂️\n //\n // Should be safe to use here since we're just focusing an input.\n useIsomorphicLayoutEffect(function () {\n if (lastEventType === NAVIGATE || lastEventType === ESCAPE || lastEventType === SELECT_WITH_CLICK || lastEventType === OPEN_WITH_BUTTON) {\n var _inputRef$current2;\n\n (_inputRef$current2 = inputRef.current) == null ? void 0 : _inputRef$current2.focus();\n }\n }, [inputRef, lastEventType]);\n}\n/**\n * We want the same events when the input or the popup have focus (HOW COOL ARE\n * HOOKS BTW?) This is probably the hairiest piece but it's not bad.\n */\n\n\nfunction useKeyDown() {\n var _React$useContext8 = useContext(ComboboxContext),\n navigationValue = _React$useContext8.data.navigationValue,\n onSelect = _React$useContext8.onSelect,\n state = _React$useContext8.state,\n transition = _React$useContext8.transition,\n autocompletePropRef = _React$useContext8.autocompletePropRef,\n persistSelectionRef = _React$useContext8.persistSelectionRef,\n isControlledRef = _React$useContext8.isControlledRef;\n\n var options = useDescendants(ComboboxDescendantContext);\n return function handleKeyDown(event) {\n var index = options.findIndex(function (_ref7) {\n var value = _ref7.value;\n return value === navigationValue;\n });\n\n function getNextOption() {\n var atBottom = index === options.length - 1;\n\n if (atBottom) {\n if (autocompletePropRef.current) {\n // Go back to the value the user has typed because we are\n // autocompleting and they need to be able to get back to what\n // they had typed w/o having to backspace out.\n return null;\n } else {\n // cycle through\n return getFirstOption();\n }\n } else {\n // Go to the next item in the list\n return options[(index + 1) % options.length];\n }\n }\n\n function getPreviousOption() {\n var atTop = index === 0;\n\n if (atTop) {\n if (autocompletePropRef.current) {\n // Go back to the value the user has typed because we are\n // autocompleting and they need to be able to get back to what\n // they had typed w/o having to backspace out.\n return null;\n } else {\n // cycle through\n return getLastOption();\n }\n } else if (index === -1) {\n // displaying the user's value, so go select the last one\n return getLastOption();\n } else {\n // normal case, select previous\n return options[(index - 1 + options.length) % options.length];\n }\n }\n\n function getFirstOption() {\n return options[0];\n }\n\n function getLastOption() {\n return options[options.length - 1];\n }\n\n switch (event.key) {\n case \"ArrowDown\":\n // Don't scroll the page\n event.preventDefault();\n\n if (!options || !options.length) {\n return;\n }\n\n if (state === IDLE) {\n // Opening a closed list\n transition(NAVIGATE, {\n persistSelection: persistSelectionRef.current\n });\n } else {\n var next = getNextOption();\n transition(NAVIGATE, {\n value: next ? next.value : null\n });\n }\n\n break;\n // A lot of duplicate code with ArrowDown up next, I'm already over it.\n\n case \"ArrowUp\":\n // Don't scroll the page\n event.preventDefault();\n\n if (!options || options.length === 0) {\n return;\n }\n\n if (state === IDLE) {\n transition(NAVIGATE);\n } else {\n var prev = getPreviousOption();\n transition(NAVIGATE, {\n value: prev ? prev.value : null\n });\n }\n\n break;\n\n case \"Home\":\n case \"PageUp\":\n // Don't scroll the page\n event.preventDefault();\n\n if (!options || options.length === 0) {\n return;\n }\n\n if (state === IDLE) {\n transition(NAVIGATE);\n } else {\n transition(NAVIGATE, {\n value: getFirstOption().value\n });\n }\n\n break;\n\n case \"End\":\n case \"PageDown\":\n // Don't scroll the page\n event.preventDefault();\n\n if (!options || options.length === 0) {\n return;\n }\n\n if (state === IDLE) {\n transition(NAVIGATE);\n } else {\n transition(NAVIGATE, {\n value: getLastOption().value\n });\n }\n\n break;\n\n case \"Escape\":\n if (state !== IDLE) {\n transition(ESCAPE);\n }\n\n break;\n\n case \"Enter\":\n if (state === NAVIGATING && navigationValue !== null) {\n // don't want to submit forms\n event.preventDefault();\n onSelect && onSelect(navigationValue);\n transition(SELECT_WITH_KEYBOARD, {\n isControlled: isControlledRef.current\n });\n }\n\n break;\n }\n };\n}\n\nfunction useBlur() {\n var _React$useContext9 = useContext(ComboboxContext),\n state = _React$useContext9.state,\n transition = _React$useContext9.transition,\n popoverRef = _React$useContext9.popoverRef,\n inputRef = _React$useContext9.inputRef,\n buttonRef = _React$useContext9.buttonRef;\n\n return function handleBlur(event) {\n var popover = popoverRef.current;\n var input = inputRef.current;\n var button = buttonRef.current;\n var activeElement = event.relatedTarget; // we on want to close only if focus propss outside the combobox\n\n if (activeElement !== input && activeElement !== button && popover) {\n if (popover.contains(activeElement)) {\n // focus landed inside the combobox, keep it open\n if (state !== INTERACTING) {\n transition(INTERACT);\n }\n } else {\n // focus landed outside the combobox, close it.\n transition(BLUR);\n }\n }\n };\n}\n/**\n * This manages transitions between states with a built in reducer to manage\n * the data that goes with those transitions.\n *\n * @param chart\n * @param reducer\n * @param initialData\n */\n\n\nfunction useReducerMachine(chart, reducer, initialData) {\n var _React$useState = useState(chart.initial),\n state = _React$useState[0],\n setState = _React$useState[1];\n\n var _React$useReducer = useReducer(reducer, initialData),\n data = _React$useReducer[0],\n dispatch = _React$useReducer[1];\n\n var transition = function transition(event, payload) {\n if (payload === void 0) {\n payload = {};\n }\n\n var currentState = chart.states[state];\n var nextState = currentState && currentState.on[event];\n\n if (nextState) {\n dispatch(_extends({\n type: event,\n state: state,\n nextState: state\n }, payload));\n setState(nextState);\n return;\n }\n };\n\n return [state, data, transition];\n}\n/**\n * We don't want to track the active descendant with indexes because nothing is\n * more annoying in a combobox than having it change values RIGHT AS YOU HIT\n * ENTER. That only happens if you use the index as your data, rather than\n * *your data as your data*. We use this to generate a unique ID based on the\n * value of each item. This function is short, sweet, and good enough™ (I also\n * don't know how it works, tbqh)\n *\n * @see https://stackoverflow.com/questions/6122571/simple-non-secure-hash-function-for-javascript\n * @param str\n */\n\n\nfunction makeHash(str) {\n var hash = 0;\n\n if (str.length === 0) {\n return hash;\n }\n\n for (var i = 0; i < str.length; i++) {\n var _char = str.charCodeAt(i);\n\n hash = (hash << 5) - hash + _char;\n hash = hash & hash;\n }\n\n return hash;\n} // function getActiveElement(node: Element | null | undefined) {\n// let activeElement: Element | null = null;\n// try {\n// // If Element.getRootNode is supported, we'll retrieve either the root\n// // Document or shadow root depending on where the component is rendered.\n// // https://github.com/reach/reach-ui/issues/787\n// activeElement = (node?.getRootNode() as ShadowRoot | Document)\n// .activeElement;\n// } finally {\n// return activeElement || (node?.ownerDocument || document).activeElement;\n// }\n// }\n\n\nfunction getDataState(state) {\n return state.toLowerCase();\n}\n/**\n * Escape regexp special characters in `str`\n *\n * @see https://github.com/component/escape-regexp/blob/5ce923c1510c9802b3da972c90b6861dd2829b6b/index.js\n * @param str\n */\n\n\nfunction escapeRegexp(str) {\n return String(str).replace(/([.*+?=^!:${}()|[\\]/\\\\])/g, \"\\\\$1\");\n} //////////////////////////\n//////////////////////////////////////////////////////\n\n/**\n * A hook that exposes data for a given `Combobox` component to its descendants.\n *\n * @see Docs https://reach.tech/combobox#usecomboboxcontext\n */\n\nfunction useComboboxContext() {\n var _React$useContext10 = useContext(ComboboxContext),\n isExpanded = _React$useContext10.isExpanded,\n comboboxId = _React$useContext10.comboboxId,\n data = _React$useContext10.data,\n state = _React$useContext10.state;\n\n var navigationValue = data.navigationValue;\n return useMemo(function () {\n return {\n id: comboboxId,\n isExpanded: isExpanded,\n navigationValue: navigationValue != null ? navigationValue : null,\n state: state\n };\n }, [comboboxId, isExpanded, navigationValue, state]);\n}\n/**\n * A hook that exposes data for a given `ComboboxOption` component to its descendants.\n *\n * @see Docs https://reach.tech/combobox#usecomboboxcontext\n */\n\nfunction useComboboxOptionContext() {\n var _React$useContext11 = useContext(OptionContext),\n value = _React$useContext11.value,\n index = _React$useContext11.index;\n\n return useMemo(function () {\n return {\n value: value,\n index: index\n };\n }, [value, index]);\n} ////////////////////////////////////////////////////////////////////////////////\n// Well alright, you made it all the way here to like 1100 lines of code (geez,\n// what the heck?). Have a great day :D\n////////////////////////////////////////////////////////////////////////////////\n// Types\n\nexport { Combobox, ComboboxButton, ComboboxInput, ComboboxList, ComboboxOption, ComboboxOptionText, ComboboxPopover, escapeRegexp, useKeyDown as unstable_useKeyDown, useComboboxContext, useComboboxOptionContext };\n","/**\n * Provided a duration and a function, returns a new function which is called\n * `duration` milliseconds after the last call.\n */\nexport default function debounce any>(\n duration: number,\n fn: F,\n) {\n let timeout: number | null;\n return function (...args) {\n if (timeout) {\n window.clearTimeout(timeout);\n }\n timeout = window.setTimeout(() => {\n timeout = null;\n fn(...args);\n }, duration);\n } as F;\n}\n","import {\n Combobox,\n ComboboxInput,\n ComboboxPopover,\n ComboboxList,\n ComboboxOption,\n} from '@reach/combobox';\nimport {\n GraphQLArgument,\n GraphQLField,\n GraphQLInputField,\n GraphQLNamedType,\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n} from 'graphql';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { MagnifyingGlassIcon } from '../../icons';\nimport { useSchemaContext } from '../../schema';\nimport debounce from '../../utility/debounce';\n\nimport { useExplorerContext } from '../context';\n\nimport './search.css';\nimport { renderType } from './utils';\n\nexport function Search() {\n const { explorerNavStack, push } = useExplorerContext({\n nonNull: true,\n caller: Search,\n });\n\n const inputRef = useRef(null);\n const popoverRef = useRef(null);\n\n const getSearchResults = useSearchResults();\n const [searchValue, setSearchValue] = useState('');\n\n const [results, setResults] = useState(getSearchResults(searchValue));\n const debouncedGetSearchResults = useMemo(\n () =>\n debounce(200, (search: string) => {\n setResults(getSearchResults(search));\n }),\n [getSearchResults],\n );\n useEffect(() => {\n debouncedGetSearchResults(searchValue);\n }, [debouncedGetSearchResults, searchValue]);\n\n useEffect(() => {\n function handleKeyDown(event: KeyboardEvent) {\n if (event.metaKey && event.keyCode === 75 && inputRef.current) {\n inputRef.current.focus();\n }\n }\n window.addEventListener('keydown', handleKeyDown);\n return () => window.removeEventListener('keydown', handleKeyDown);\n }, []);\n\n const navItem = explorerNavStack.at(-1)!;\n\n const shouldSearchBoxAppear =\n explorerNavStack.length === 1 ||\n isObjectType(navItem.def) ||\n isInterfaceType(navItem.def) ||\n isInputObjectType(navItem.def);\n\n return shouldSearchBoxAppear ? (\n {\n const def = value as unknown as TypeMatch | FieldMatch;\n push(\n 'field' in def\n ? { name: def.field.name, def: def.field }\n : { name: def.type.name, def: def.type },\n );\n }}\n >\n {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n }}\n >\n \n {\n setSearchValue(event.target.value);\n }}\n onKeyDown={event => {\n if (!event.isDefaultPrevented()) {\n const container = popoverRef.current;\n if (!container) {\n return;\n }\n\n window.requestAnimationFrame(() => {\n const element = container.querySelector('[aria-selected=true]');\n if (!(element instanceof HTMLElement)) {\n return;\n }\n const top = element.offsetTop - container.scrollTop;\n const bottom =\n container.scrollTop +\n container.clientHeight -\n (element.offsetTop + element.clientHeight);\n if (bottom < 0) {\n container.scrollTop -= bottom;\n }\n if (top < 0) {\n container.scrollTop += top;\n }\n });\n }\n\n // We don't want for example \"Escape\" key presses to bubble up\n // further. This could have other effects like closing a dialog\n // that contains this component.\n event.stopPropagation();\n }}\n placeholder=\"⌘ K\"\n ref={inputRef}\n value={searchValue}\n />\n
    \n \n \n {/**\n * Setting the `index` prop explicitly on the `ComboboxOption` solves\n * buggy behavior of the internal ordering of the combobox items.\n * (Sometimes this results in weird jumps when using the keyboard to\n * navigate search results.)\n */}\n {results.within.map((result, i) => (\n \n \n \n ))}\n {results.within.length > 0 &&\n results.types.length + results.fields.length > 0 ? (\n
    \n Other results\n
    \n ) : null}\n {results.types.map((result, i) => (\n \n \n \n ))}\n {results.fields.map((result, i) => (\n \n .\n \n \n ))}\n {results.within.length +\n results.types.length +\n results.fields.length ===\n 0 ? (\n
    \n No results found\n
    \n ) : null}\n
    \n
    \n \n ) : null;\n}\n\ntype TypeMatch = { type: GraphQLNamedType };\n\ntype FieldMatch = {\n type: GraphQLNamedType;\n field: GraphQLField | GraphQLInputField;\n argument?: GraphQLArgument;\n};\n\nexport function useSearchResults(caller?: Function) {\n const { explorerNavStack } = useExplorerContext({\n nonNull: true,\n caller: caller || useSearchResults,\n });\n const { schema } = useSchemaContext({\n nonNull: true,\n caller: caller || useSearchResults,\n });\n\n const navItem = explorerNavStack.at(-1)!;\n\n return useCallback(\n (searchValue: string) => {\n const matches: {\n within: FieldMatch[];\n types: TypeMatch[];\n fields: FieldMatch[];\n } = {\n within: [],\n types: [],\n fields: [],\n };\n\n if (!schema) {\n return matches;\n }\n\n const withinType = navItem.def;\n\n const typeMap = schema.getTypeMap();\n let typeNames = Object.keys(typeMap);\n\n // Move the within type name to be the first searched.\n if (withinType) {\n typeNames = typeNames.filter(n => n !== withinType.name);\n typeNames.unshift(withinType.name);\n }\n\n for (const typeName of typeNames) {\n if (\n matches.within.length +\n matches.types.length +\n matches.fields.length >=\n 100\n ) {\n break;\n }\n\n const type = typeMap[typeName];\n if (withinType !== type && isMatch(typeName, searchValue)) {\n matches.types.push({ type });\n }\n\n if (\n !isObjectType(type) &&\n !isInterfaceType(type) &&\n !isInputObjectType(type)\n ) {\n continue;\n }\n\n const fields = type.getFields();\n for (const fieldName in fields) {\n const field = fields[fieldName];\n let matchingArgs: GraphQLArgument[] | undefined;\n\n if (!isMatch(fieldName, searchValue)) {\n if ('args' in field) {\n matchingArgs = field.args.filter(arg =>\n isMatch(arg.name, searchValue),\n );\n if (matchingArgs.length === 0) {\n continue;\n }\n } else {\n continue;\n }\n }\n\n matches[withinType === type ? 'within' : 'fields'].push(\n ...(matchingArgs\n ? matchingArgs.map(argument => ({ type, field, argument }))\n : [{ type, field }]),\n );\n }\n }\n\n return matches;\n },\n [navItem.def, schema],\n );\n}\n\nfunction isMatch(sourceText: string, searchValue: string) {\n try {\n const escaped = searchValue.replaceAll(/[^_0-9A-Za-z]/g, ch => '\\\\' + ch);\n return sourceText.search(new RegExp(escaped, 'i')) !== -1;\n } catch {\n return sourceText.toLowerCase().includes(searchValue.toLowerCase());\n }\n}\n\ntype TypeProps = { type: GraphQLNamedType };\n\nfunction Type(props: TypeProps) {\n return (\n {props.type.name}\n );\n}\n\ntype FieldProps = {\n field: GraphQLField | GraphQLInputField;\n argument?: GraphQLArgument;\n};\n\nfunction Field(props: FieldProps) {\n return (\n <>\n \n {props.field.name}\n \n {props.argument ? (\n <>\n (\n \n {props.argument.name}\n \n :{' '}\n {renderType(props.argument.type, namedType => (\n \n ))}\n )\n \n ) : null}\n \n );\n}\n","import { ExplorerFieldDef, useExplorerContext } from '../context';\n\nimport './field-link.css';\n\ntype FieldLinkProps = {\n /**\n * The field or argument that should be linked to.\n */\n field: ExplorerFieldDef;\n};\n\nexport function FieldLink(props: FieldLinkProps) {\n const { push } = useExplorerContext({ nonNull: true });\n\n return (\n {\n event.preventDefault();\n push({ name: props.field.name, def: props.field });\n }}\n href=\"#\"\n >\n {props.field.name}\n \n );\n}\n","import {\n GraphQLEnumValue,\n GraphQLNamedType,\n isAbstractType,\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isNamedType,\n isObjectType,\n} from 'graphql';\nimport { useState } from 'react';\n\nimport { useSchemaContext } from '../../schema';\nimport { Button, MarkdownContent } from '../../ui';\nimport { ExplorerFieldDef } from '../context';\nimport { Argument } from './argument';\nimport { DefaultValue } from './default-value';\nimport { DeprecationReason } from './deprecation-reason';\nimport { FieldLink } from './field-link';\nimport { ExplorerSection } from './section';\nimport { TypeLink } from './type-link';\n\nimport './type-documentation.css';\n\ntype TypeDocumentationProps = {\n /**\n * The type that should be rendered.\n */\n type: GraphQLNamedType;\n};\n\nexport function TypeDocumentation(props: TypeDocumentationProps) {\n return isNamedType(props.type) ? (\n <>\n {props.type.description ? (\n \n {props.type.description}\n \n ) : null}\n \n \n \n \n \n ) : null;\n}\n\nfunction ImplementsInterfaces({ type }: { type: GraphQLNamedType }) {\n if (!isObjectType(type)) {\n return null;\n }\n const interfaces = type.getInterfaces();\n return interfaces.length > 0 ? (\n \n {type.getInterfaces().map(implementedInterface => (\n
    \n \n
    \n ))}\n
    \n ) : null;\n}\n\nfunction Fields({ type }: { type: GraphQLNamedType }) {\n const [showDeprecated, setShowDeprecated] = useState(false);\n if (\n !isObjectType(type) &&\n !isInterfaceType(type) &&\n !isInputObjectType(type)\n ) {\n return null;\n }\n\n const fieldMap = type.getFields();\n\n const fields: ExplorerFieldDef[] = [];\n const deprecatedFields: ExplorerFieldDef[] = [];\n\n for (const field of Object.keys(fieldMap).map(name => fieldMap[name])) {\n if (field.deprecationReason) {\n deprecatedFields.push(field);\n } else {\n fields.push(field);\n }\n }\n\n return (\n <>\n {fields.length > 0 ? (\n \n {fields.map(field => (\n \n ))}\n \n ) : null}\n {deprecatedFields.length > 0 ? (\n showDeprecated || fields.length === 0 ? (\n \n {deprecatedFields.map(field => (\n \n ))}\n \n ) : (\n {\n setShowDeprecated(true);\n }}\n >\n Show Deprecated Fields\n \n )\n ) : null}\n \n );\n}\n\nfunction Field({ field }: { field: ExplorerFieldDef }) {\n const args =\n 'args' in field ? field.args.filter(arg => !arg.deprecationReason) : [];\n return (\n
    \n
    \n \n {args.length > 0 ? (\n <>\n (\n \n {args.map(arg =>\n args.length === 1 ? (\n \n ) : (\n \n \n
    \n ),\n )}\n \n )\n \n ) : null}\n {': '}\n \n \n
    \n {field.description ? (\n \n {field.description}\n \n ) : null}\n {field.deprecationReason}\n \n );\n}\n\nfunction EnumValues({ type }: { type: GraphQLNamedType }) {\n const [showDeprecated, setShowDeprecated] = useState(false);\n\n if (!isEnumType(type)) {\n return null;\n }\n\n const values: GraphQLEnumValue[] = [];\n const deprecatedValues: GraphQLEnumValue[] = [];\n for (const value of type.getValues()) {\n if (value.deprecationReason) {\n deprecatedValues.push(value);\n } else {\n values.push(value);\n }\n }\n\n return (\n <>\n {values.length > 0 ? (\n \n {values.map(value => (\n \n ))}\n \n ) : null}\n {deprecatedValues.length > 0 ? (\n showDeprecated || values.length === 0 ? (\n \n {deprecatedValues.map(value => (\n \n ))}\n \n ) : (\n {\n setShowDeprecated(true);\n }}\n >\n Show Deprecated Values\n \n )\n ) : null}\n \n );\n}\n\nfunction EnumValue({ value }: { value: GraphQLEnumValue }) {\n return (\n
    \n
    {value.name}
    \n {value.description ? (\n \n {value.description}\n \n ) : null}\n {value.deprecationReason ? (\n \n {value.deprecationReason}\n \n ) : null}\n
    \n );\n}\n\nfunction PossibleTypes({ type }: { type: GraphQLNamedType }) {\n const { schema } = useSchemaContext({ nonNull: true });\n if (!schema || !isAbstractType(type)) {\n return null;\n }\n return (\n \n {schema.getPossibleTypes(type).map(possibleType => (\n
    \n \n
    \n ))}\n \n );\n}\n","import { isType } from 'graphql';\nimport { ReactNode } from 'react';\n\nimport { ChevronLeftIcon } from '../../icons';\nimport { useSchemaContext } from '../../schema';\nimport { Spinner } from '../../ui';\nimport { useExplorerContext } from '../context';\nimport { FieldDocumentation } from './field-documentation';\nimport { SchemaDocumentation } from './schema-documentation';\nimport { Search } from './search';\nimport { TypeDocumentation } from './type-documentation';\n\nimport './doc-explorer.css';\n\nexport function DocExplorer() {\n const { fetchError, isFetching, schema, validationErrors } = useSchemaContext(\n { nonNull: true, caller: DocExplorer },\n );\n const { explorerNavStack, pop } = useExplorerContext({\n nonNull: true,\n caller: DocExplorer,\n });\n\n const navItem = explorerNavStack.at(-1)!;\n\n let content: ReactNode = null;\n if (fetchError) {\n content = (\n
    Error fetching schema
    \n );\n } else if (validationErrors.length > 0) {\n content = (\n
    \n Schema is invalid: {validationErrors[0].message}\n
    \n );\n } else if (isFetching) {\n // Schema is undefined when it is being loaded via introspection.\n content = ;\n } else if (!schema) {\n // Schema is null when it explicitly does not exist, typically due to\n // an error during introspection.\n content = (\n
    \n No GraphQL schema available\n
    \n );\n } else if (explorerNavStack.length === 1) {\n content = ;\n } else if (isType(navItem.def)) {\n content = ;\n } else if (navItem.def) {\n content = ;\n }\n\n let prevName;\n if (explorerNavStack.length > 1) {\n prevName = explorerNavStack.at(-2)!.name;\n }\n\n return (\n \n
    \n
    \n {prevName && (\n {\n event.preventDefault();\n pop();\n }}\n aria-label={`Go back to ${prevName}`}\n >\n \n {prevName}\n \n )}\n
    {navItem.name}
    \n
    \n
    \n \n
    \n
    \n
    {content}
    \n \n );\n}\n","import {\n ComponentType,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { DocExplorer, useExplorerContext } from './explorer';\nimport { History, useHistoryContext } from './history';\nimport { DocsFilledIcon, DocsIcon, HistoryIcon } from './icons';\nimport { useStorageContext } from './storage';\nimport { createContextHook, createNullableContext } from './utility/context';\n\nexport type GraphiQLPlugin = {\n /**\n * A component that renders content into the plugin pane.\n */\n content: ComponentType;\n /**\n * A component that renders an icon that will be shown inside a button that\n * toggles the plugin visibility.\n */\n icon: ComponentType;\n /**\n * The unique title of the plugin. If two plugins are present with the same\n * title the provider component will throw an error.\n */\n title: string;\n};\n\nexport const DOC_EXPLORER_PLUGIN: GraphiQLPlugin = {\n title: 'Documentation Explorer',\n icon: function Icon() {\n const pluginContext = usePluginContext();\n return pluginContext?.visiblePlugin === DOC_EXPLORER_PLUGIN ? (\n \n ) : (\n \n );\n },\n content: DocExplorer,\n};\nexport const HISTORY_PLUGIN: GraphiQLPlugin = {\n title: 'History',\n icon: HistoryIcon,\n content: History,\n};\n\nexport type PluginContextType = {\n /**\n * A list of all current plugins, including the built-in ones (the doc\n * explorer and the history).\n */\n plugins: GraphiQLPlugin[];\n /**\n * Defines the plugin which is currently visible.\n * @param plugin The plugin that should become visible. You can either pass\n * the plugin object (has to be referentially equal to the one passed as\n * prop) or the plugin title as string. If `null` is passed, no plugin will\n * be visible.\n */\n setVisiblePlugin(plugin: GraphiQLPlugin | string | null): void;\n /**\n * The plugin which is currently visible.\n */\n visiblePlugin: GraphiQLPlugin | null;\n};\n\nexport const PluginContext =\n createNullableContext('PluginContext');\n\nexport type PluginContextProviderProps = {\n children: ReactNode;\n /**\n * Invoked when the visibility state of any plugin changes.\n * @param visiblePlugin The plugin object that is now visible. If no plugin\n * is visible, the function will be invoked with `null`.\n */\n onTogglePluginVisibility?(visiblePlugin: GraphiQLPlugin | null): void;\n /**\n * This props accepts a list of plugins that will be shown in addition to the\n * built-in ones (the doc explorer and the history).\n */\n plugins?: GraphiQLPlugin[];\n /**\n * This prop can be used to set the visibility state of plugins. Every time\n * this prop changes, the visibility state will be overridden. Note that the\n * visibility state can change in between these updates, for example by\n * calling the `setVisiblePlugin` function provided by the context.\n */\n visiblePlugin?: GraphiQLPlugin | string;\n};\n\nexport function PluginContextProvider(props: PluginContextProviderProps) {\n const storage = useStorageContext();\n const explorerContext = useExplorerContext();\n const historyContext = useHistoryContext();\n\n const hasExplorerContext = Boolean(explorerContext);\n const hasHistoryContext = Boolean(historyContext);\n const plugins = useMemo(() => {\n const pluginList: GraphiQLPlugin[] = [];\n const pluginTitles: Record = {};\n\n if (hasExplorerContext) {\n pluginList.push(DOC_EXPLORER_PLUGIN);\n pluginTitles[DOC_EXPLORER_PLUGIN.title] = true;\n }\n if (hasHistoryContext) {\n pluginList.push(HISTORY_PLUGIN);\n pluginTitles[HISTORY_PLUGIN.title] = true;\n }\n\n for (const plugin of props.plugins || []) {\n if (typeof plugin.title !== 'string' || !plugin.title) {\n throw new Error('All GraphiQL plugins must have a unique title');\n }\n if (pluginTitles[plugin.title]) {\n throw new Error(\n `All GraphiQL plugins must have a unique title, found two plugins with the title '${plugin.title}'`,\n );\n } else {\n pluginList.push(plugin);\n pluginTitles[plugin.title] = true;\n }\n }\n\n return pluginList;\n }, [hasExplorerContext, hasHistoryContext, props.plugins]);\n\n const [visiblePlugin, internalSetVisiblePlugin] =\n useState(() => {\n const storedValue = storage?.get(STORAGE_KEY);\n const pluginForStoredValue = plugins.find(\n plugin => plugin.title === storedValue,\n );\n if (pluginForStoredValue) {\n return pluginForStoredValue;\n }\n if (storedValue) {\n storage?.set(STORAGE_KEY, '');\n }\n\n if (!props.visiblePlugin) {\n return null;\n }\n\n return (\n plugins.find(\n plugin =>\n (typeof props.visiblePlugin === 'string'\n ? plugin.title\n : plugin) === props.visiblePlugin,\n ) || null\n );\n });\n\n const { onTogglePluginVisibility, children } = props;\n const setVisiblePlugin = useCallback(\n plugin => {\n const newVisiblePlugin = plugin\n ? plugins.find(\n p => (typeof plugin === 'string' ? p.title : p) === plugin,\n ) || null\n : null;\n internalSetVisiblePlugin(current => {\n if (newVisiblePlugin === current) {\n return current;\n }\n onTogglePluginVisibility?.(newVisiblePlugin);\n return newVisiblePlugin;\n });\n },\n [onTogglePluginVisibility, plugins],\n );\n\n useEffect(() => {\n if (props.visiblePlugin) {\n setVisiblePlugin(props.visiblePlugin);\n }\n }, [plugins, props.visiblePlugin, setVisiblePlugin]);\n\n const value = useMemo(\n () => ({ plugins, setVisiblePlugin, visiblePlugin }),\n [plugins, setVisiblePlugin, visiblePlugin],\n );\n\n return (\n {children}\n );\n}\n\nexport const usePluginContext = createContextHook(PluginContext);\n\nconst STORAGE_KEY = 'visiblePlugin';\n","import type { Editor, EditorChange } from 'codemirror';\nimport type { IHint } from 'codemirror-graphql/hint';\nimport {\n GraphQLNamedType,\n GraphQLSchema,\n GraphQLType,\n isListType,\n isNonNullType,\n} from 'graphql';\n\nimport { ExplorerContextType } from '../explorer';\nimport { markdown } from '../markdown';\nimport { DOC_EXPLORER_PLUGIN, PluginContextType } from '../plugin';\nimport { importCodeMirror } from './common';\n\n/**\n * Render a custom UI for CodeMirror's hint which includes additional info\n * about the type and description for the selected context.\n */\nexport function onHasCompletion(\n _cm: Editor,\n data: EditorChange | undefined,\n schema: GraphQLSchema | null | undefined,\n explorer: ExplorerContextType | null,\n plugin: PluginContextType | null,\n callback?: (type: GraphQLNamedType) => void,\n) {\n importCodeMirror([], { useCommonAddons: false }).then(CodeMirror => {\n let information: HTMLDivElement | null;\n let fieldName: HTMLSpanElement | null;\n let typeNamePill: HTMLSpanElement | null;\n let typeNamePrefix: HTMLSpanElement | null;\n let typeName: HTMLAnchorElement | null;\n let typeNameSuffix: HTMLSpanElement | null;\n let description: HTMLDivElement | null;\n let deprecation: HTMLDivElement | null;\n let deprecationReason: HTMLDivElement | null;\n CodeMirror.on(\n data,\n 'select',\n // @ts-expect-error\n (ctx: IHint, el: HTMLDivElement) => {\n // Only the first time (usually when the hint UI is first displayed)\n // do we create the information nodes.\n if (!information) {\n const hintsUl = el.parentNode as HTMLUListElement & ParentNode;\n\n // This \"information\" node will contain the additional info about the\n // highlighted typeahead option.\n information = document.createElement('div');\n information.className = 'CodeMirror-hint-information';\n hintsUl.appendChild(information);\n\n const header = document.createElement('header');\n header.className = 'CodeMirror-hint-information-header';\n information.appendChild(header);\n\n fieldName = document.createElement('span');\n fieldName.className = 'CodeMirror-hint-information-field-name';\n header.appendChild(fieldName);\n\n typeNamePill = document.createElement('span');\n typeNamePill.className = 'CodeMirror-hint-information-type-name-pill';\n header.appendChild(typeNamePill);\n\n typeNamePrefix = document.createElement('span');\n typeNamePill.appendChild(typeNamePrefix);\n\n typeName = document.createElement('a');\n typeName.className = 'CodeMirror-hint-information-type-name';\n typeName.href = 'javascript:void 0'; // eslint-disable-line no-script-url\n typeName.addEventListener('click', onClickHintInformation);\n typeNamePill.appendChild(typeName);\n\n typeNameSuffix = document.createElement('span');\n typeNamePill.appendChild(typeNameSuffix);\n\n description = document.createElement('div');\n description.className = 'CodeMirror-hint-information-description';\n information.appendChild(description);\n\n deprecation = document.createElement('div');\n deprecation.className = 'CodeMirror-hint-information-deprecation';\n information.appendChild(deprecation);\n\n const deprecationLabel = document.createElement('span');\n deprecationLabel.className =\n 'CodeMirror-hint-information-deprecation-label';\n deprecationLabel.innerText = 'Deprecated';\n deprecation.appendChild(deprecationLabel);\n\n deprecationReason = document.createElement('div');\n deprecationReason.className =\n 'CodeMirror-hint-information-deprecation-reason';\n deprecation.appendChild(deprecationReason);\n\n /**\n * This is a bit hacky: By default, codemirror renders all hints\n * inside a single container element. The only possibility to add\n * something into this list is to add to the container element (which\n * is a `ul` element).\n *\n * However, in the UI we want to have a two-column layout for the\n * hints:\n * - The first column contains the actual hints, i.e. the things that\n * are returned from the `hint` module from `codemirror-graphql`.\n * - The second column contains the description and optionally the\n * deprecation reason for the given field.\n *\n * We solve this with a CSS grid layout that has an auto number of\n * rows and two columns. All the hints go in the first column, and\n * the description container (which is the `information` element\n * here) goes in the second column. To make the hints scrollable, the\n * container element has `overflow-y: auto`.\n *\n * Now here comes the crux: When scrolling down the list of hints we\n * still want the description to be \"sticky\" to the top. We can't\n * solve this with `position: sticky` as the container element itself\n * is already positioned absolutely.\n *\n * There are two things to the solution here:\n * - We add a `max-height` and another `overflow: auto` to the\n * `information` element. This makes it scrollable on its own\n * if the description or deprecation reason is higher that the\n * container element.\n * - We add an `onscroll` handler to the container element. When the\n * user scrolls here we dynamically adjust the top padding and the\n * max-height of the information element such that it looks like\n * it's sticking to the top. (Since the `information` element has\n * some padding by default we also have to make sure to use this\n * as baseline for the total padding.)\n * Note that we need to also adjust the max-height because we\n * default to using `border-box` for box sizing. When using\n * `content-box` this would not be necessary.\n */\n const defaultInformationPadding =\n parseInt(\n window\n .getComputedStyle(information)\n .paddingBottom.replace(/px$/, ''),\n 10,\n ) || 0;\n const defaultInformationMaxHeight =\n parseInt(\n window.getComputedStyle(information).maxHeight.replace(/px$/, ''),\n 10,\n ) || 0;\n const handleScroll = () => {\n if (information) {\n information.style.paddingTop =\n hintsUl.scrollTop + defaultInformationPadding + 'px';\n information.style.maxHeight =\n hintsUl.scrollTop + defaultInformationMaxHeight + 'px';\n }\n };\n hintsUl.addEventListener('scroll', handleScroll);\n\n // When CodeMirror attempts to remove the hint UI, we detect that it was\n // removed and in turn remove the information nodes.\n let onRemoveFn: EventListener | null;\n hintsUl.addEventListener(\n 'DOMNodeRemoved',\n (onRemoveFn = (event: Event) => {\n if (event.target === hintsUl) {\n hintsUl.removeEventListener('scroll', handleScroll);\n hintsUl.removeEventListener('DOMNodeRemoved', onRemoveFn);\n if (information) {\n information.removeEventListener(\n 'click',\n onClickHintInformation,\n );\n }\n information = null;\n fieldName = null;\n typeNamePill = null;\n typeNamePrefix = null;\n typeName = null;\n typeNameSuffix = null;\n description = null;\n deprecation = null;\n deprecationReason = null;\n onRemoveFn = null;\n }\n }),\n );\n }\n\n if (fieldName) {\n fieldName.innerText = ctx.text;\n }\n\n if (typeNamePill && typeNamePrefix && typeName && typeNameSuffix) {\n if (ctx.type) {\n typeNamePill.style.display = 'inline';\n\n const renderType = (type: GraphQLType) => {\n if (isNonNullType(type)) {\n typeNameSuffix!.innerText = '!' + typeNameSuffix!.innerText;\n renderType(type.ofType);\n } else if (isListType(type)) {\n typeNamePrefix!.innerText += '[';\n typeNameSuffix!.innerText = ']' + typeNameSuffix!.innerText;\n renderType(type.ofType);\n } else {\n typeName!.innerText = type.name;\n }\n };\n\n typeNamePrefix.innerText = '';\n typeNameSuffix.innerText = '';\n renderType(ctx.type);\n } else {\n typeNamePrefix.innerText = '';\n typeName.innerText = '';\n typeNameSuffix.innerText = '';\n typeNamePill.style.display = 'none';\n }\n }\n\n if (description) {\n if (ctx.description) {\n description.style.display = 'block';\n description.innerHTML = markdown.render(ctx.description);\n } else {\n description.style.display = 'none';\n description.innerHTML = '';\n }\n }\n\n if (deprecation && deprecationReason) {\n if (ctx.deprecationReason) {\n deprecation.style.display = 'block';\n deprecationReason.innerHTML = markdown.render(\n ctx.deprecationReason,\n );\n } else {\n deprecation.style.display = 'none';\n deprecationReason.innerHTML = '';\n }\n }\n },\n );\n });\n\n function onClickHintInformation(event: Event) {\n if (\n !schema ||\n !explorer ||\n !plugin ||\n !(event.currentTarget instanceof HTMLElement)\n ) {\n return;\n }\n\n const typeName = event.currentTarget.innerText;\n const type = schema.getType(typeName);\n if (type) {\n plugin.setVisiblePlugin(DOC_EXPLORER_PLUGIN);\n explorer.push({ name: type.name, def: type });\n callback?.(type);\n }\n }\n}\n","import { fillLeafs, GetDefaultFieldNamesFn, mergeAst } from '@graphiql/toolkit';\nimport type { EditorChange, EditorConfiguration } from 'codemirror';\nimport type { SchemaReference } from 'codemirror-graphql/utils/SchemaReference';\nimport copyToClipboard from 'copy-to-clipboard';\nimport { parse, print } from 'graphql';\nimport { useCallback, useEffect } from 'react';\n\nimport { useExplorerContext } from '../explorer';\nimport { usePluginContext } from '../plugin';\nimport { useSchemaContext } from '../schema';\nimport { useStorageContext } from '../storage';\nimport debounce from '../utility/debounce';\nimport { onHasCompletion } from './completion';\nimport { useEditorContext } from './context';\nimport { CodeMirrorEditor } from './types';\n\nexport function useSynchronizeValue(\n editor: CodeMirrorEditor | null,\n value: string | undefined,\n) {\n useEffect(() => {\n if (editor && typeof value === 'string' && value !== editor.getValue()) {\n editor.setValue(value);\n }\n }, [editor, value]);\n}\n\nexport function useSynchronizeOption(\n editor: CodeMirrorEditor | null,\n option: K,\n value: EditorConfiguration[K],\n) {\n useEffect(() => {\n if (editor) {\n editor.setOption(option, value);\n }\n }, [editor, option, value]);\n}\n\nexport function useChangeHandler(\n editor: CodeMirrorEditor | null,\n callback: ((value: string) => void) | undefined,\n storageKey: string | null,\n tabProperty: 'variables' | 'headers',\n caller: Function,\n) {\n const { updateActiveTabValues } = useEditorContext({ nonNull: true, caller });\n const storage = useStorageContext();\n\n useEffect(() => {\n if (!editor) {\n return;\n }\n\n const store = debounce(500, (value: string) => {\n if (!storage || storageKey === null) {\n return;\n }\n storage.set(storageKey, value);\n });\n\n const updateTab = debounce(100, (value: string) => {\n updateActiveTabValues({ [tabProperty]: value });\n });\n\n const handleChange = (\n editorInstance: CodeMirrorEditor,\n changeObj: EditorChange | undefined,\n ) => {\n // When we signal a change manually without actually changing anything\n // we don't want to invoke the callback.\n if (!changeObj) {\n return;\n }\n\n const newValue = editorInstance.getValue();\n store(newValue);\n updateTab(newValue);\n callback?.(newValue);\n };\n editor.on('change', handleChange);\n return () => editor.off('change', handleChange);\n }, [\n callback,\n editor,\n storage,\n storageKey,\n tabProperty,\n updateActiveTabValues,\n ]);\n}\n\nexport function useCompletion(\n editor: CodeMirrorEditor | null,\n callback: ((reference: SchemaReference) => void) | null,\n caller: Function,\n) {\n const { schema } = useSchemaContext({ nonNull: true, caller });\n const explorer = useExplorerContext();\n const plugin = usePluginContext();\n useEffect(() => {\n if (!editor) {\n return;\n }\n\n const handleCompletion = (\n instance: CodeMirrorEditor,\n changeObj?: EditorChange,\n ) => {\n onHasCompletion(instance, changeObj, schema, explorer, plugin, type => {\n callback?.({ kind: 'Type', type, schema: schema || undefined });\n });\n };\n editor.on(\n // @ts-expect-error @TODO additional args for hasCompletion event\n 'hasCompletion',\n handleCompletion,\n );\n return () =>\n editor.off(\n // @ts-expect-error @TODO additional args for hasCompletion event\n 'hasCompletion',\n handleCompletion,\n );\n }, [callback, editor, explorer, plugin, schema]);\n}\n\ntype EmptyCallback = () => void;\n\nexport function useKeyMap(\n editor: CodeMirrorEditor | null,\n keys: string[],\n callback: EmptyCallback | undefined,\n) {\n useEffect(() => {\n if (!editor) {\n return;\n }\n for (const key of keys) {\n editor.removeKeyMap(key);\n }\n\n if (callback) {\n const keyMap: Record = {};\n for (const key of keys) {\n keyMap[key] = () => callback();\n }\n editor.addKeyMap(keyMap);\n }\n }, [editor, keys, callback]);\n}\n\nexport type UseCopyQueryArgs = {\n /**\n * This is only meant to be used internally in `@graphiql/react`.\n */\n caller?: Function;\n /**\n * Invoked when the current contents of the query editor are copied to the\n * clipboard.\n * @param query The content that has been copied.\n */\n onCopyQuery?: (query: string) => void;\n};\n\nexport function useCopyQuery({ caller, onCopyQuery }: UseCopyQueryArgs = {}) {\n const { queryEditor } = useEditorContext({\n nonNull: true,\n caller: caller || useCopyQuery,\n });\n return useCallback(() => {\n if (!queryEditor) {\n return;\n }\n\n const query = queryEditor.getValue();\n copyToClipboard(query);\n\n onCopyQuery?.(query);\n }, [queryEditor, onCopyQuery]);\n}\n\ntype UseMergeQueryArgs = {\n /**\n * This is only meant to be used internally in `@graphiql/react`.\n */\n caller?: Function;\n};\n\nexport function useMergeQuery({ caller }: UseMergeQueryArgs = {}) {\n const { queryEditor } = useEditorContext({\n nonNull: true,\n caller: caller || useMergeQuery,\n });\n const { schema } = useSchemaContext({ nonNull: true, caller: useMergeQuery });\n return useCallback(() => {\n const documentAST = queryEditor?.documentAST;\n const query = queryEditor?.getValue();\n if (!documentAST || !query) {\n return;\n }\n\n queryEditor.setValue(print(mergeAst(documentAST, schema)));\n }, [queryEditor, schema]);\n}\n\ntype UsePrettifyEditorsArgs = {\n /**\n * This is only meant to be used internally in `@graphiql/react`.\n */\n caller?: Function;\n};\n\nexport function usePrettifyEditors({ caller }: UsePrettifyEditorsArgs = {}) {\n const { queryEditor, headerEditor, variableEditor } = useEditorContext({\n nonNull: true,\n caller: caller || usePrettifyEditors,\n });\n return useCallback(() => {\n if (variableEditor) {\n const variableEditorContent = variableEditor.getValue();\n try {\n const prettifiedVariableEditorContent = JSON.stringify(\n JSON.parse(variableEditorContent),\n null,\n 2,\n );\n if (prettifiedVariableEditorContent !== variableEditorContent) {\n variableEditor.setValue(prettifiedVariableEditorContent);\n }\n } catch {\n /* Parsing JSON failed, skip prettification */\n }\n }\n\n if (headerEditor) {\n const headerEditorContent = headerEditor.getValue();\n\n try {\n const prettifiedHeaderEditorContent = JSON.stringify(\n JSON.parse(headerEditorContent),\n null,\n 2,\n );\n if (prettifiedHeaderEditorContent !== headerEditorContent) {\n headerEditor.setValue(prettifiedHeaderEditorContent);\n }\n } catch {\n /* Parsing JSON failed, skip prettification */\n }\n }\n\n if (queryEditor) {\n const editorContent = queryEditor.getValue();\n const prettifiedEditorContent = print(parse(editorContent));\n\n if (prettifiedEditorContent !== editorContent) {\n queryEditor.setValue(prettifiedEditorContent);\n }\n }\n }, [queryEditor, variableEditor, headerEditor]);\n}\n\nexport type UseAutoCompleteLeafsArgs = {\n /**\n * A function to determine which field leafs are automatically added when\n * trying to execute a query with missing selection sets. It will be called\n * with the `GraphQLType` for which fields need to be added.\n */\n getDefaultFieldNames?: GetDefaultFieldNamesFn;\n /**\n * This is only meant to be used internally in `@graphiql/react`.\n */\n caller?: Function;\n};\n\nexport function useAutoCompleteLeafs({\n getDefaultFieldNames,\n caller,\n}: UseAutoCompleteLeafsArgs = {}) {\n const { schema } = useSchemaContext({\n nonNull: true,\n caller: caller || useAutoCompleteLeafs,\n });\n const { queryEditor } = useEditorContext({\n nonNull: true,\n caller: caller || useAutoCompleteLeafs,\n });\n return useCallback(() => {\n if (!queryEditor) {\n return;\n }\n\n const query = queryEditor.getValue();\n const { insertions, result } = fillLeafs(\n schema,\n query,\n getDefaultFieldNames,\n );\n if (insertions && insertions.length > 0) {\n queryEditor.operation(() => {\n const cursor = queryEditor.getCursor();\n const cursorIndex = queryEditor.indexFromPos(cursor);\n queryEditor.setValue(result || '');\n let added = 0;\n const markers = insertions.map(({ index, string }) =>\n queryEditor.markText(\n queryEditor.posFromIndex(index + added),\n queryEditor.posFromIndex(index + (added += string.length)),\n {\n className: 'auto-inserted-leaf',\n clearOnEnter: true,\n title: 'Automatically added leaf fields',\n },\n ),\n );\n setTimeout(() => markers.forEach(marker => marker.clear()), 7000);\n let newCursorIndex = cursorIndex;\n insertions.forEach(({ index, string }) => {\n if (index < cursorIndex) {\n newCursorIndex += string.length;\n }\n });\n queryEditor.setCursor(queryEditor.posFromIndex(newCursorIndex));\n });\n }\n\n return result;\n }, [getDefaultFieldNames, queryEditor, schema]);\n}\n","import { useEffect, useRef } from 'react';\n\nimport { useExecutionContext } from '../execution';\nimport {\n commonKeys,\n DEFAULT_EDITOR_THEME,\n DEFAULT_KEY_MAP,\n importCodeMirror,\n} from './common';\nimport { useEditorContext } from './context';\nimport {\n useChangeHandler,\n useKeyMap,\n useMergeQuery,\n usePrettifyEditors,\n useSynchronizeOption,\n} from './hooks';\nimport { WriteableEditorProps } from './types';\n\nexport type UseHeaderEditorArgs = WriteableEditorProps & {\n /**\n * Invoked when the contents of the headers editor change.\n * @param value The new contents of the editor.\n */\n onEdit?(value: string): void;\n};\n\nexport function useHeaderEditor(\n {\n editorTheme = DEFAULT_EDITOR_THEME,\n keyMap = DEFAULT_KEY_MAP,\n onEdit,\n readOnly = false,\n }: UseHeaderEditorArgs = {},\n caller?: Function,\n) {\n const {\n initialHeaders,\n headerEditor,\n setHeaderEditor,\n shouldPersistHeaders,\n } = useEditorContext({\n nonNull: true,\n caller: caller || useHeaderEditor,\n });\n const executionContext = useExecutionContext();\n const merge = useMergeQuery({ caller: caller || useHeaderEditor });\n const prettify = usePrettifyEditors({ caller: caller || useHeaderEditor });\n const ref = useRef(null);\n\n useEffect(() => {\n let isActive = true;\n\n importCodeMirror([\n // @ts-expect-error\n import('codemirror/mode/javascript/javascript'),\n ]).then(CodeMirror => {\n // Don't continue if the effect has already been cleaned up\n if (!isActive) {\n return;\n }\n\n const container = ref.current;\n if (!container) {\n return;\n }\n\n const newEditor = CodeMirror(container, {\n value: initialHeaders,\n lineNumbers: true,\n tabSize: 2,\n mode: { name: 'javascript', json: true },\n theme: editorTheme,\n autoCloseBrackets: true,\n matchBrackets: true,\n showCursorWhenSelecting: true,\n readOnly: readOnly ? 'nocursor' : false,\n foldGutter: true,\n gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'],\n extraKeys: commonKeys,\n });\n\n newEditor.addKeyMap({\n 'Cmd-Space'() {\n newEditor.showHint({ completeSingle: false, container });\n },\n 'Ctrl-Space'() {\n newEditor.showHint({ completeSingle: false, container });\n },\n 'Alt-Space'() {\n newEditor.showHint({ completeSingle: false, container });\n },\n 'Shift-Space'() {\n newEditor.showHint({ completeSingle: false, container });\n },\n });\n\n newEditor.on('keyup', (editorInstance, event) => {\n const code = event.keyCode;\n if (\n (code >= 65 && code <= 90) || // letters\n (!event.shiftKey && code >= 48 && code <= 57) || // numbers\n (event.shiftKey && code === 189) || // underscore\n (event.shiftKey && code === 222) // \"\n ) {\n editorInstance.execCommand('autocomplete');\n }\n });\n\n setHeaderEditor(newEditor);\n });\n\n return () => {\n isActive = false;\n };\n }, [editorTheme, initialHeaders, readOnly, setHeaderEditor]);\n\n useSynchronizeOption(headerEditor, 'keyMap', keyMap);\n\n useChangeHandler(\n headerEditor,\n onEdit,\n shouldPersistHeaders ? STORAGE_KEY : null,\n 'headers',\n useHeaderEditor,\n );\n\n useKeyMap(headerEditor, ['Cmd-Enter', 'Ctrl-Enter'], executionContext?.run);\n useKeyMap(headerEditor, ['Shift-Ctrl-P'], prettify);\n useKeyMap(headerEditor, ['Shift-Ctrl-M'], merge);\n\n return ref;\n}\n\nexport const STORAGE_KEY = 'headers';\n","// Unicode whitespace characters that break the interface.\nexport const invalidCharacters = Array.from({ length: 11 }, (_, i) => {\n // \\u2000 -> \\u200a\n return String.fromCharCode(0x2000 + i);\n}).concat(['\\u2028', '\\u2029', '\\u202f', '\\u00a0']);\n\nconst sanitizeRegex = new RegExp('[' + invalidCharacters.join('') + ']', 'g');\n\nexport function normalizeWhitespace(line: string) {\n return line.replace(sanitizeRegex, ' ');\n}\n","import { getSelectedOperationName } from '@graphiql/toolkit';\nimport type { SchemaReference } from 'codemirror-graphql/utils/SchemaReference';\nimport type {\n DocumentNode,\n FragmentDefinitionNode,\n GraphQLSchema,\n ValidationRule,\n} from 'graphql';\nimport { getOperationFacts } from 'graphql-language-service';\nimport {\n MutableRefObject,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n} from 'react';\n\nimport { useExecutionContext } from '../execution';\nimport { useExplorerContext } from '../explorer';\nimport { markdown } from '../markdown';\nimport { DOC_EXPLORER_PLUGIN, usePluginContext } from '../plugin';\nimport { useSchemaContext } from '../schema';\nimport { useStorageContext } from '../storage';\nimport debounce from '../utility/debounce';\nimport {\n commonKeys,\n DEFAULT_EDITOR_THEME,\n DEFAULT_KEY_MAP,\n importCodeMirror,\n} from './common';\nimport {\n CodeMirrorEditorWithOperationFacts,\n useEditorContext,\n} from './context';\nimport {\n useCompletion,\n useCopyQuery,\n UseCopyQueryArgs,\n useKeyMap,\n useMergeQuery,\n usePrettifyEditors,\n useSynchronizeOption,\n} from './hooks';\nimport {\n CodeMirrorEditor,\n CodeMirrorType,\n WriteableEditorProps,\n} from './types';\nimport { normalizeWhitespace } from './whitespace';\n\nexport type UseQueryEditorArgs = WriteableEditorProps &\n Pick & {\n /**\n * Invoked when a reference to the GraphQL schema (type or field) is clicked\n * as part of the editor or one of its tooltips.\n * @param reference The reference that has been clicked.\n */\n onClickReference?(reference: SchemaReference): void;\n /**\n * Invoked when the contents of the query editor change.\n * @param value The new contents of the editor.\n * @param documentAST The editor contents parsed into a GraphQL document.\n */\n onEdit?(value: string, documentAST?: DocumentNode): void;\n };\n\nexport function useQueryEditor(\n {\n editorTheme = DEFAULT_EDITOR_THEME,\n keyMap = DEFAULT_KEY_MAP,\n onClickReference,\n onCopyQuery,\n onEdit,\n readOnly = false,\n }: UseQueryEditorArgs = {},\n caller?: Function,\n) {\n const { schema } = useSchemaContext({\n nonNull: true,\n caller: caller || useQueryEditor,\n });\n const {\n externalFragments,\n initialQuery,\n queryEditor,\n setOperationName,\n setQueryEditor,\n validationRules,\n variableEditor,\n updateActiveTabValues,\n } = useEditorContext({\n nonNull: true,\n caller: caller || useQueryEditor,\n });\n const executionContext = useExecutionContext();\n const storage = useStorageContext();\n const explorer = useExplorerContext();\n const plugin = usePluginContext();\n const copy = useCopyQuery({ caller: caller || useQueryEditor, onCopyQuery });\n const merge = useMergeQuery({ caller: caller || useQueryEditor });\n const prettify = usePrettifyEditors({ caller: caller || useQueryEditor });\n const ref = useRef(null);\n const codeMirrorRef = useRef();\n\n const onClickReferenceRef = useRef<\n NonNullable\n >(() => {});\n useEffect(() => {\n onClickReferenceRef.current = reference => {\n if (!explorer || !plugin) {\n return;\n }\n plugin.setVisiblePlugin(DOC_EXPLORER_PLUGIN);\n switch (reference.kind) {\n case 'Type': {\n explorer.push({ name: reference.type.name, def: reference.type });\n break;\n }\n case 'Field': {\n explorer.push({ name: reference.field.name, def: reference.field });\n break;\n }\n case 'Argument': {\n if (reference.field) {\n explorer.push({ name: reference.field.name, def: reference.field });\n }\n break;\n }\n case 'EnumValue': {\n if (reference.type) {\n explorer.push({ name: reference.type.name, def: reference.type });\n }\n break;\n }\n }\n onClickReference?.(reference);\n };\n }, [explorer, onClickReference, plugin]);\n\n useEffect(() => {\n let isActive = true;\n\n importCodeMirror([\n import('codemirror/addon/comment/comment'),\n import('codemirror/addon/search/search'),\n import('codemirror-graphql/esm/hint'),\n import('codemirror-graphql/esm/lint'),\n import('codemirror-graphql/esm/info'),\n import('codemirror-graphql/esm/jump'),\n import('codemirror-graphql/esm/mode'),\n ]).then(CodeMirror => {\n // Don't continue if the effect has already been cleaned up\n if (!isActive) {\n return;\n }\n\n codeMirrorRef.current = CodeMirror;\n\n const container = ref.current;\n if (!container) {\n return;\n }\n\n const newEditor = CodeMirror(container, {\n value: initialQuery,\n lineNumbers: true,\n tabSize: 2,\n foldGutter: true,\n mode: 'graphql',\n theme: editorTheme,\n autoCloseBrackets: true,\n matchBrackets: true,\n showCursorWhenSelecting: true,\n readOnly: readOnly ? 'nocursor' : false,\n lint: {\n // @ts-expect-error\n schema: undefined,\n validationRules: null,\n // linting accepts string or FragmentDefinitionNode[]\n externalFragments: undefined,\n },\n hintOptions: {\n // @ts-expect-error\n schema: undefined,\n closeOnUnfocus: false,\n completeSingle: false,\n container,\n externalFragments: undefined,\n },\n info: {\n schema: undefined,\n renderDescription: (text: string) => markdown.render(text),\n onClick: (reference: SchemaReference) => {\n onClickReferenceRef.current(reference);\n },\n },\n jump: {\n schema: undefined,\n onClick: (reference: SchemaReference) => {\n onClickReferenceRef.current(reference);\n },\n },\n gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'],\n extraKeys: {\n ...commonKeys,\n 'Cmd-S'() {\n // empty\n },\n 'Ctrl-S'() {\n // empty\n },\n },\n }) as CodeMirrorEditorWithOperationFacts;\n\n newEditor.addKeyMap({\n 'Cmd-Space'() {\n newEditor.showHint({ completeSingle: true, container });\n },\n 'Ctrl-Space'() {\n newEditor.showHint({ completeSingle: true, container });\n },\n 'Alt-Space'() {\n newEditor.showHint({ completeSingle: true, container });\n },\n 'Shift-Space'() {\n newEditor.showHint({ completeSingle: true, container });\n },\n 'Shift-Alt-Space'() {\n newEditor.showHint({ completeSingle: true, container });\n },\n });\n\n newEditor.on('keyup', (editorInstance, event) => {\n if (AUTO_COMPLETE_AFTER_KEY.test(event.key)) {\n editorInstance.execCommand('autocomplete');\n }\n });\n\n let showingHints = false;\n\n // fired whenever a hint dialog opens\n newEditor.on('startCompletion', () => {\n showingHints = true;\n });\n\n // the codemirror hint extension fires this anytime the dialog is closed\n // via any method (e.g. focus blur, escape key, ...)\n newEditor.on('endCompletion', () => {\n showingHints = false;\n });\n\n newEditor.on('keydown', (editorInstance, event) => {\n if (event.key === 'Escape' && showingHints) {\n event.stopPropagation();\n }\n });\n\n newEditor.on('beforeChange', (editorInstance, change) => {\n // The update function is only present on non-redo, non-undo events.\n if (change.origin === 'paste') {\n const text = change.text.map(normalizeWhitespace);\n change.update?.(change.from, change.to, text);\n }\n });\n\n newEditor.documentAST = null;\n newEditor.operationName = null;\n newEditor.operations = null;\n newEditor.variableToType = null;\n\n setQueryEditor(newEditor);\n });\n\n return () => {\n isActive = false;\n };\n }, [editorTheme, initialQuery, readOnly, setQueryEditor]);\n\n useSynchronizeOption(queryEditor, 'keyMap', keyMap);\n\n /**\n * We don't use the generic `useChangeHandler` hook here because we want to\n * have additional logic that updates the operation facts that we store as\n * properties on the editor.\n */\n useEffect(() => {\n if (!queryEditor) {\n return;\n }\n\n function getAndUpdateOperationFacts(\n editorInstance: CodeMirrorEditorWithOperationFacts,\n ) {\n const operationFacts = getOperationFacts(\n schema,\n editorInstance.getValue(),\n );\n\n // Update operation name should any query names change.\n const operationName = getSelectedOperationName(\n editorInstance.operations ?? undefined,\n editorInstance.operationName ?? undefined,\n operationFacts?.operations,\n );\n\n // Store the operation facts on editor properties\n editorInstance.documentAST = operationFacts?.documentAST ?? null;\n editorInstance.operationName = operationName ?? null;\n editorInstance.operations = operationFacts?.operations ?? null;\n\n // Update variable types for the variable editor\n if (variableEditor) {\n variableEditor.state.lint.linterOptions.variableToType =\n operationFacts?.variableToType;\n variableEditor.options.lint.variableToType =\n operationFacts?.variableToType;\n variableEditor.options.hintOptions.variableToType =\n operationFacts?.variableToType;\n codeMirrorRef.current?.signal(variableEditor, 'change', variableEditor);\n }\n\n return operationFacts ? { ...operationFacts, operationName } : null;\n }\n\n const handleChange = debounce(\n 100,\n (editorInstance: CodeMirrorEditorWithOperationFacts) => {\n const query = editorInstance.getValue();\n storage?.set(STORAGE_KEY_QUERY, query);\n\n const currentOperationName = editorInstance.operationName;\n const operationFacts = getAndUpdateOperationFacts(editorInstance);\n if (operationFacts?.operationName !== undefined) {\n storage?.set(\n STORAGE_KEY_OPERATION_NAME,\n operationFacts.operationName,\n );\n }\n\n // Invoke callback props only after the operation facts have been updated\n onEdit?.(query, operationFacts?.documentAST);\n if (\n operationFacts?.operationName &&\n currentOperationName !== operationFacts.operationName\n ) {\n setOperationName(operationFacts.operationName);\n }\n\n updateActiveTabValues({\n query,\n operationName: operationFacts?.operationName ?? null,\n });\n },\n ) as (editorInstance: CodeMirrorEditor) => void;\n\n // Call once to initially update the values\n getAndUpdateOperationFacts(queryEditor);\n\n queryEditor.on('change', handleChange);\n return () => queryEditor.off('change', handleChange);\n }, [\n onEdit,\n queryEditor,\n schema,\n setOperationName,\n storage,\n variableEditor,\n updateActiveTabValues,\n ]);\n\n useSynchronizeSchema(queryEditor, schema ?? null, codeMirrorRef);\n useSynchronizeValidationRules(\n queryEditor,\n validationRules ?? null,\n codeMirrorRef,\n );\n useSynchronizeExternalFragments(\n queryEditor,\n externalFragments,\n codeMirrorRef,\n );\n\n useCompletion(queryEditor, onClickReference || null, useQueryEditor);\n\n const run = executionContext?.run;\n const runAtCursor = useCallback(() => {\n if (\n !run ||\n !queryEditor ||\n !queryEditor.operations ||\n !queryEditor.hasFocus()\n ) {\n run?.();\n return;\n }\n\n const cursorIndex = queryEditor.indexFromPos(queryEditor.getCursor());\n\n // Loop through all operations to see if one contains the cursor.\n let operationName: string | undefined;\n for (const operation of queryEditor.operations) {\n if (\n operation.loc &&\n operation.loc.start <= cursorIndex &&\n operation.loc.end >= cursorIndex\n ) {\n operationName = operation.name?.value;\n }\n }\n\n if (operationName && operationName !== queryEditor.operationName) {\n setOperationName(operationName);\n }\n\n run();\n }, [queryEditor, run, setOperationName]);\n\n useKeyMap(queryEditor, ['Cmd-Enter', 'Ctrl-Enter'], runAtCursor);\n useKeyMap(queryEditor, ['Shift-Ctrl-C'], copy);\n useKeyMap(\n queryEditor,\n [\n 'Shift-Ctrl-P',\n // Shift-Ctrl-P is hard coded in Firefox for private browsing so adding an alternative to prettify\n 'Shift-Ctrl-F',\n ],\n prettify,\n );\n useKeyMap(queryEditor, ['Shift-Ctrl-M'], merge);\n\n return ref;\n}\n\nfunction useSynchronizeSchema(\n editor: CodeMirrorEditor | null,\n schema: GraphQLSchema | null,\n codeMirrorRef: MutableRefObject,\n) {\n useEffect(() => {\n if (!editor) {\n return;\n }\n\n const didChange = editor.options.lint.schema !== schema;\n\n editor.state.lint.linterOptions.schema = schema;\n editor.options.lint.schema = schema;\n editor.options.hintOptions.schema = schema;\n editor.options.info.schema = schema;\n editor.options.jump.schema = schema;\n\n if (didChange && codeMirrorRef.current) {\n codeMirrorRef.current.signal(editor, 'change', editor);\n }\n }, [editor, schema, codeMirrorRef]);\n}\n\nfunction useSynchronizeValidationRules(\n editor: CodeMirrorEditor | null,\n validationRules: ValidationRule[] | null,\n codeMirrorRef: MutableRefObject,\n) {\n useEffect(() => {\n if (!editor) {\n return;\n }\n\n const didChange = editor.options.lint.validationRules !== validationRules;\n\n editor.state.lint.linterOptions.validationRules = validationRules;\n editor.options.lint.validationRules = validationRules;\n\n if (didChange && codeMirrorRef.current) {\n codeMirrorRef.current.signal(editor, 'change', editor);\n }\n }, [editor, validationRules, codeMirrorRef]);\n}\n\nfunction useSynchronizeExternalFragments(\n editor: CodeMirrorEditor | null,\n externalFragments: Map,\n codeMirrorRef: MutableRefObject,\n) {\n const externalFragmentList = useMemo(\n () => [...externalFragments.values()],\n [externalFragments],\n );\n\n useEffect(() => {\n if (!editor) {\n return;\n }\n\n const didChange =\n editor.options.lint.externalFragments !== externalFragmentList;\n\n editor.state.lint.linterOptions.externalFragments = externalFragmentList;\n editor.options.lint.externalFragments = externalFragmentList;\n editor.options.hintOptions.externalFragments = externalFragmentList;\n\n if (didChange && codeMirrorRef.current) {\n codeMirrorRef.current.signal(editor, 'change', editor);\n }\n }, [editor, externalFragmentList, codeMirrorRef]);\n}\n\nconst AUTO_COMPLETE_AFTER_KEY = /^[a-zA-Z0-9_@(]$/;\n\nexport const STORAGE_KEY_QUERY = 'query';\n\nconst STORAGE_KEY_OPERATION_NAME = 'operationName';\n","import { StorageAPI } from '@graphiql/toolkit';\nimport { useCallback, useMemo } from 'react';\n\nimport debounce from '../utility/debounce';\nimport { CodeMirrorEditorWithOperationFacts } from './context';\nimport { CodeMirrorEditor } from './types';\n\nexport type TabDefinition = {\n /**\n * The contents of the query editor of this tab.\n */\n query: string | null;\n /**\n * The contents of the variable editor of this tab.\n */\n variables?: string | null;\n /**\n * The contents of the headers editor of this tab.\n */\n headers?: string | null;\n};\n\n/**\n * This object describes the state of a single tab.\n */\nexport type TabState = TabDefinition & {\n /**\n * A GUID value generated when the tab was created.\n */\n id: string;\n /**\n * A hash that is unique for a combination of the contents of the query\n * editor, the variable editor and the header editor (i.e. all the editor\n * where the contents are persisted in storage).\n */\n hash: string;\n /**\n * The title of the tab shown in the tab element.\n */\n title: string;\n /**\n * The operation name derived from the contents of the query editor of this\n * tab.\n */\n operationName: string | null;\n /**\n * The contents of the response editor of this tab.\n */\n response: string | null;\n};\n\n/**\n * This object describes the state of all tabs.\n */\nexport type TabsState = {\n /**\n * A list of state objects for each tab.\n */\n tabs: TabState[];\n /**\n * The index of the currently active tab with regards to the `tabs` list of\n * this object.\n */\n activeTabIndex: number;\n};\n\nexport function getDefaultTabState({\n defaultQuery,\n defaultHeaders,\n headers,\n defaultTabs,\n query,\n variables,\n storage,\n}: {\n defaultQuery: string;\n defaultHeaders?: string;\n headers: string | null;\n defaultTabs?: TabDefinition[];\n query: string | null;\n variables: string | null;\n storage: StorageAPI | null;\n}) {\n const storedState = storage?.get(STORAGE_KEY);\n try {\n if (!storedState) {\n throw new Error('Storage for tabs is empty');\n }\n const parsed = JSON.parse(storedState);\n if (isTabsState(parsed)) {\n const expectedHash = hashFromTabContents({ query, variables, headers });\n let matchingTabIndex = -1;\n\n for (let index = 0; index < parsed.tabs.length; index++) {\n const tab = parsed.tabs[index];\n tab.hash = hashFromTabContents({\n query: tab.query,\n variables: tab.variables,\n headers: tab.headers,\n });\n if (tab.hash === expectedHash) {\n matchingTabIndex = index;\n }\n }\n\n if (matchingTabIndex >= 0) {\n parsed.activeTabIndex = matchingTabIndex;\n } else {\n const operationName = query ? fuzzyExtractOperationName(query) : null;\n parsed.tabs.push({\n id: guid(),\n hash: expectedHash,\n title: operationName || DEFAULT_TITLE,\n query,\n variables,\n headers,\n operationName,\n response: null,\n });\n parsed.activeTabIndex = parsed.tabs.length - 1;\n }\n\n return parsed;\n }\n throw new Error('Storage for tabs is invalid');\n } catch {\n return {\n activeTabIndex: 0,\n tabs: (\n defaultTabs || [\n {\n query: query ?? defaultQuery,\n variables,\n headers: headers ?? defaultHeaders,\n },\n ]\n ).map(createTab),\n };\n }\n}\n\nfunction isTabsState(obj: any): obj is TabsState {\n return (\n obj &&\n typeof obj === 'object' &&\n !Array.isArray(obj) &&\n hasNumberKey(obj, 'activeTabIndex') &&\n 'tabs' in obj &&\n Array.isArray(obj.tabs) &&\n obj.tabs.every(isTabState)\n );\n}\n\nfunction isTabState(obj: any): obj is TabState {\n // We don't persist the hash, so we skip the check here\n return (\n obj &&\n typeof obj === 'object' &&\n !Array.isArray(obj) &&\n hasStringKey(obj, 'id') &&\n hasStringKey(obj, 'title') &&\n hasStringOrNullKey(obj, 'query') &&\n hasStringOrNullKey(obj, 'variables') &&\n hasStringOrNullKey(obj, 'headers') &&\n hasStringOrNullKey(obj, 'operationName') &&\n hasStringOrNullKey(obj, 'response')\n );\n}\n\nfunction hasNumberKey(obj: Record, key: string) {\n return key in obj && typeof obj[key] === 'number';\n}\n\nfunction hasStringKey(obj: Record, key: string) {\n return key in obj && typeof obj[key] === 'string';\n}\n\nfunction hasStringOrNullKey(obj: Record, key: string) {\n return key in obj && (typeof obj[key] === 'string' || obj[key] === null);\n}\n\nexport function useSynchronizeActiveTabValues({\n queryEditor,\n variableEditor,\n headerEditor,\n responseEditor,\n}: {\n queryEditor: CodeMirrorEditorWithOperationFacts | null;\n variableEditor: CodeMirrorEditor | null;\n headerEditor: CodeMirrorEditor | null;\n responseEditor: CodeMirrorEditor | null;\n}) {\n return useCallback<(state: TabsState) => TabsState>(\n state => {\n const query = queryEditor?.getValue() ?? null;\n const variables = variableEditor?.getValue() ?? null;\n const headers = headerEditor?.getValue() ?? null;\n const operationName = queryEditor?.operationName ?? null;\n const response = responseEditor?.getValue() ?? null;\n return setPropertiesInActiveTab(state, {\n query,\n variables,\n headers,\n response,\n operationName,\n });\n },\n [queryEditor, variableEditor, headerEditor, responseEditor],\n );\n}\n\nexport function serializeTabState(\n tabState: TabsState,\n shouldPersistHeaders = false,\n) {\n return JSON.stringify(tabState, (key, value) =>\n key === 'hash' ||\n key === 'response' ||\n (!shouldPersistHeaders && key === 'headers')\n ? null\n : value,\n );\n}\n\nexport function useStoreTabs({\n storage,\n shouldPersistHeaders,\n}: {\n storage: StorageAPI | null;\n shouldPersistHeaders?: boolean;\n}) {\n const store = useMemo(\n () =>\n debounce(500, (value: string) => {\n storage?.set(STORAGE_KEY, value);\n }),\n [storage],\n );\n return useCallback(\n (currentState: TabsState) => {\n store(serializeTabState(currentState, shouldPersistHeaders));\n },\n [shouldPersistHeaders, store],\n );\n}\n\nexport function useSetEditorValues({\n queryEditor,\n variableEditor,\n headerEditor,\n responseEditor,\n}: {\n queryEditor: CodeMirrorEditorWithOperationFacts | null;\n variableEditor: CodeMirrorEditor | null;\n headerEditor: CodeMirrorEditor | null;\n responseEditor: CodeMirrorEditor | null;\n}) {\n return useCallback(\n ({\n query,\n variables,\n headers,\n response,\n }: {\n query: string | null;\n variables?: string | null;\n headers?: string | null;\n response: string | null;\n }) => {\n queryEditor?.setValue(query ?? '');\n variableEditor?.setValue(variables ?? '');\n headerEditor?.setValue(headers ?? '');\n responseEditor?.setValue(response ?? '');\n },\n [headerEditor, queryEditor, responseEditor, variableEditor],\n );\n}\n\nexport function createTab({\n query = null,\n variables = null,\n headers = null,\n}: Partial = {}): TabState {\n return {\n id: guid(),\n hash: hashFromTabContents({ query, variables, headers }),\n title: (query && fuzzyExtractOperationName(query)) || DEFAULT_TITLE,\n query,\n variables,\n headers,\n operationName: null,\n response: null,\n };\n}\n\nexport function setPropertiesInActiveTab(\n state: TabsState,\n partialTab: Partial>,\n): TabsState {\n return {\n ...state,\n tabs: state.tabs.map((tab, index) => {\n if (index !== state.activeTabIndex) {\n return tab;\n }\n const newTab = { ...tab, ...partialTab };\n return {\n ...newTab,\n hash: hashFromTabContents(newTab),\n title:\n newTab.operationName ||\n (newTab.query\n ? fuzzyExtractOperationName(newTab.query)\n : undefined) ||\n DEFAULT_TITLE,\n };\n }),\n };\n}\n\nfunction guid(): string {\n const s4 = () => {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .slice(1);\n };\n // return id of format 'aaaaaaaa'-'aaaa'-'aaaa'-'aaaa'-'aaaaaaaaaaaa'\n return `${s4()}${s4()}-${s4()}-${s4()}-${s4()}-${s4()}${s4()}${s4()}`;\n}\n\nfunction hashFromTabContents(args: {\n query: string | null;\n variables?: string | null;\n headers?: string | null;\n}): string {\n return [args.query ?? '', args.variables ?? '', args.headers ?? ''].join('|');\n}\n\nexport function fuzzyExtractOperationName(str: string): string | null {\n const regex = /^(?!#).*(query|subscription|mutation)\\s+([a-zA-Z0-9_]+)/m;\n\n const match = regex.exec(str);\n\n return match?.[2] ?? null;\n}\n\nexport function clearHeadersFromTabs(storage: StorageAPI | null) {\n const persistedTabs = storage?.get(STORAGE_KEY);\n if (persistedTabs) {\n const parsedTabs = JSON.parse(persistedTabs);\n storage?.set(\n STORAGE_KEY,\n JSON.stringify(parsedTabs, (key, value) =>\n key === 'headers' ? null : value,\n ),\n );\n }\n}\n\nconst DEFAULT_TITLE = '';\n\nexport const STORAGE_KEY = 'tabState';\n","import type { SchemaReference } from 'codemirror-graphql/utils/SchemaReference';\nimport { useEffect, useRef } from 'react';\n\nimport { useExecutionContext } from '../execution';\nimport {\n commonKeys,\n DEFAULT_EDITOR_THEME,\n DEFAULT_KEY_MAP,\n importCodeMirror,\n} from './common';\nimport { useEditorContext } from './context';\nimport {\n useChangeHandler,\n useCompletion,\n useKeyMap,\n useMergeQuery,\n usePrettifyEditors,\n useSynchronizeOption,\n} from './hooks';\nimport { CodeMirrorType, WriteableEditorProps } from './types';\n\nexport type UseVariableEditorArgs = WriteableEditorProps & {\n /**\n * Invoked when a reference to the GraphQL schema (type or field) is clicked\n * as part of the editor or one of its tooltips.\n * @param reference The reference that has been clicked.\n */\n onClickReference?(reference: SchemaReference): void;\n /**\n * Invoked when the contents of the variables editor change.\n * @param value The new contents of the editor.\n */\n onEdit?(value: string): void;\n};\n\nexport function useVariableEditor(\n {\n editorTheme = DEFAULT_EDITOR_THEME,\n keyMap = DEFAULT_KEY_MAP,\n onClickReference,\n onEdit,\n readOnly = false,\n }: UseVariableEditorArgs = {},\n caller?: Function,\n) {\n const { initialVariables, variableEditor, setVariableEditor } =\n useEditorContext({\n nonNull: true,\n caller: caller || useVariableEditor,\n });\n const executionContext = useExecutionContext();\n const merge = useMergeQuery({ caller: caller || useVariableEditor });\n const prettify = usePrettifyEditors({ caller: caller || useVariableEditor });\n const ref = useRef(null);\n const codeMirrorRef = useRef();\n\n useEffect(() => {\n let isActive = true;\n\n importCodeMirror([\n import('codemirror-graphql/esm/variables/hint'),\n import('codemirror-graphql/esm/variables/lint'),\n import('codemirror-graphql/esm/variables/mode'),\n ]).then(CodeMirror => {\n // Don't continue if the effect has already been cleaned up\n if (!isActive) {\n return;\n }\n\n codeMirrorRef.current = CodeMirror;\n\n const container = ref.current;\n if (!container) {\n return;\n }\n\n const newEditor = CodeMirror(container, {\n value: initialVariables,\n lineNumbers: true,\n tabSize: 2,\n mode: 'graphql-variables',\n theme: editorTheme,\n autoCloseBrackets: true,\n matchBrackets: true,\n showCursorWhenSelecting: true,\n readOnly: readOnly ? 'nocursor' : false,\n foldGutter: true,\n lint: {\n // @ts-expect-error\n variableToType: undefined,\n },\n hintOptions: {\n closeOnUnfocus: false,\n completeSingle: false,\n container,\n // @ts-expect-error\n variableToType: undefined,\n },\n gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'],\n extraKeys: commonKeys,\n });\n\n newEditor.addKeyMap({\n 'Cmd-Space'() {\n newEditor.showHint({ completeSingle: false, container });\n },\n 'Ctrl-Space'() {\n newEditor.showHint({ completeSingle: false, container });\n },\n 'Alt-Space'() {\n newEditor.showHint({ completeSingle: false, container });\n },\n 'Shift-Space'() {\n newEditor.showHint({ completeSingle: false, container });\n },\n });\n\n newEditor.on('keyup', (editorInstance, event) => {\n const code = event.keyCode;\n if (\n (code >= 65 && code <= 90) || // letters\n (!event.shiftKey && code >= 48 && code <= 57) || // numbers\n (event.shiftKey && code === 189) || // underscore\n (event.shiftKey && code === 222) // \"\n ) {\n editorInstance.execCommand('autocomplete');\n }\n });\n\n setVariableEditor(newEditor);\n });\n\n return () => {\n isActive = false;\n };\n }, [editorTheme, initialVariables, readOnly, setVariableEditor]);\n\n useSynchronizeOption(variableEditor, 'keyMap', keyMap);\n\n useChangeHandler(\n variableEditor,\n onEdit,\n STORAGE_KEY,\n 'variables',\n useVariableEditor,\n );\n\n useCompletion(variableEditor, onClickReference || null, useVariableEditor);\n\n useKeyMap(variableEditor, ['Cmd-Enter', 'Ctrl-Enter'], executionContext?.run);\n useKeyMap(variableEditor, ['Shift-Ctrl-P'], prettify);\n useKeyMap(variableEditor, ['Shift-Ctrl-M'], merge);\n\n return ref;\n}\n\nexport const STORAGE_KEY = 'variables';\n","import {\n DocumentNode,\n FragmentDefinitionNode,\n OperationDefinitionNode,\n parse,\n ValidationRule,\n visit,\n} from 'graphql';\nimport { VariableToType } from 'graphql-language-service';\nimport {\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { useStorageContext } from '../storage';\nimport { createContextHook, createNullableContext } from '../utility/context';\nimport { STORAGE_KEY as STORAGE_KEY_HEADERS } from './header-editor';\nimport { useSynchronizeValue } from './hooks';\nimport { STORAGE_KEY_QUERY } from './query-editor';\nimport {\n createTab,\n getDefaultTabState,\n setPropertiesInActiveTab,\n TabDefinition,\n TabsState,\n TabState,\n useSetEditorValues,\n useStoreTabs,\n useSynchronizeActiveTabValues,\n clearHeadersFromTabs,\n serializeTabState,\n STORAGE_KEY as STORAGE_KEY_TABS,\n} from './tabs';\nimport { CodeMirrorEditor } from './types';\nimport { STORAGE_KEY as STORAGE_KEY_VARIABLES } from './variable-editor';\n\nexport type CodeMirrorEditorWithOperationFacts = CodeMirrorEditor & {\n documentAST: DocumentNode | null;\n operationName: string | null;\n operations: OperationDefinitionNode[] | null;\n variableToType: VariableToType | null;\n};\n\nexport type EditorContextType = TabsState & {\n /**\n * Add a new tab.\n */\n addTab(): void;\n /**\n * Switch to a different tab.\n * @param index The index of the tab that should be switched to.\n */\n changeTab(index: number): void;\n /**\n * Close a tab. If the currently active tab is closed the tab before it will\n * become active. If there is no tab before the closed one, the tab after it\n * will become active.\n * @param index The index of the tab that should be closed.\n */\n closeTab(index: number): void;\n /**\n * Update the state for the tab that is currently active. This will be\n * reflected in the `tabs` object and the state will be persisted in storage\n * (if available).\n * @param partialTab A partial tab state object that will override the\n * current values. The properties `id`, `hash` and `title` cannot be changed.\n */\n updateActiveTabValues(\n partialTab: Partial>,\n ): void;\n\n /**\n * The CodeMirror editor instance for the headers editor.\n */\n headerEditor: CodeMirrorEditor | null;\n /**\n * The CodeMirror editor instance for the query editor. This editor also\n * stores the operation facts that are derived from the current editor\n * contents.\n */\n queryEditor: CodeMirrorEditorWithOperationFacts | null;\n /**\n * The CodeMirror editor instance for the response editor.\n */\n responseEditor: CodeMirrorEditor | null;\n /**\n * The CodeMirror editor instance for the variables editor.\n */\n variableEditor: CodeMirrorEditor | null;\n /**\n * Set the CodeMirror editor instance for the headers editor.\n */\n setHeaderEditor(newEditor: CodeMirrorEditor): void;\n /**\n * Set the CodeMirror editor instance for the query editor.\n */\n setQueryEditor(newEditor: CodeMirrorEditorWithOperationFacts): void;\n /**\n * Set the CodeMirror editor instance for the response editor.\n */\n setResponseEditor(newEditor: CodeMirrorEditor): void;\n /**\n * Set the CodeMirror editor instance for the variables editor.\n */\n setVariableEditor(newEditor: CodeMirrorEditor): void;\n\n /**\n * Changes the operation name and invokes the `onEditOperationName` callback.\n */\n setOperationName(operationName: string): void;\n\n /**\n * The contents of the headers editor when initially rendering the provider\n * component.\n */\n initialHeaders: string;\n /**\n * The contents of the query editor when initially rendering the provider\n * component.\n */\n initialQuery: string;\n /**\n * The contents of the response editor when initially rendering the provider\n * component.\n */\n initialResponse: string;\n /**\n * The contents of the variables editor when initially rendering the provider\n * component.\n */\n initialVariables: string;\n\n /**\n * A map of fragment definitions using the fragment name as key which are\n * made available to include in the query.\n */\n externalFragments: Map;\n /**\n * A list of custom validation rules that are run in addition to the rules\n * provided by the GraphQL spec.\n */\n validationRules: ValidationRule[];\n\n /**\n * If the contents of the headers editor are persisted in storage.\n */\n shouldPersistHeaders: boolean;\n /**\n * Changes if headers should be persisted.\n */\n setShouldPersistHeaders(persist: boolean): void;\n};\n\nexport const EditorContext =\n createNullableContext('EditorContext');\n\nexport type EditorContextProviderProps = {\n children: ReactNode;\n /**\n * The initial contents of the query editor when loading GraphiQL and there\n * is no other source for the editor state. Other sources can be:\n * - The `query` prop\n * - The value persisted in storage\n * These default contents will only be used for the first tab. When opening\n * more tabs the query editor will start out empty.\n */\n defaultQuery?: string;\n /**\n * With this prop you can pass so-called \"external\" fragments that will be\n * included in the query document (depending on usage). You can either pass\n * the fragments using SDL (passing a string) or you can pass a list of\n * `FragmentDefinitionNode` objects.\n */\n externalFragments?: string | FragmentDefinitionNode[];\n /**\n * This prop can be used to set the contents of the headers editor. Every\n * time this prop changes, the contents of the headers editor are replaced.\n * Note that the editor contents can be changed in between these updates by\n * typing in the editor.\n */\n headers?: string;\n /**\n * @deprecated Use `defaultTabs` instead.\n */\n initialTabs?: TabDefinition[];\n /**\n * This prop can be used to define the default set of tabs, with their\n * queries, variables, and headers. It will be used as default only if\n * there is no tab state persisted in storage.\n *\n * @example\n * ```tsx\n * \n *```\n */\n defaultTabs?: TabDefinition[];\n /**\n * Invoked when the operation name changes. Possible triggers are:\n * - Editing the contents of the query editor\n * - Selecting a operation for execution in a document that contains multiple\n * operation definitions\n * @param operationName The operation name after it has been changed.\n */\n onEditOperationName?(operationName: string): void;\n /**\n * Invoked when the state of the tabs changes. Possible triggers are:\n * - Updating any editor contents inside the currently active tab\n * - Adding a tab\n * - Switching to a different tab\n * - Closing a tab\n * @param tabState The tabs state after it has been updated.\n */\n onTabChange?(tabState: TabsState): void;\n /**\n * This prop can be used to set the contents of the query editor. Every time\n * this prop changes, the contents of the query editor are replaced. Note\n * that the editor contents can be changed in between these updates by typing\n * in the editor.\n */\n query?: string;\n /**\n * This prop can be used to set the contents of the response editor. Every\n * time this prop changes, the contents of the response editor are replaced.\n * Note that the editor contents can change in between these updates by\n * executing queries that will show a response.\n */\n response?: string;\n /**\n * This prop toggles if the contents of the headers editor are persisted in\n * storage.\n * @default false\n */\n shouldPersistHeaders?: boolean;\n /**\n * This prop accepts custom validation rules for GraphQL documents that are\n * run against the contents of the query editor (in addition to the rules\n * that are specified in the GraphQL spec).\n */\n validationRules?: ValidationRule[];\n /**\n * This prop can be used to set the contents of the variables editor. Every\n * time this prop changes, the contents of the variables editor are replaced.\n * Note that the editor contents can be changed in between these updates by\n * typing in the editor.\n */\n variables?: string;\n\n /**\n * Headers to be set when opening a new tab\n */\n defaultHeaders?: string;\n};\n\nexport function EditorContextProvider(props: EditorContextProviderProps) {\n const storage = useStorageContext();\n const [headerEditor, setHeaderEditor] = useState(\n null,\n );\n const [queryEditor, setQueryEditor] =\n useState(null);\n const [responseEditor, setResponseEditor] = useState(\n null,\n );\n const [variableEditor, setVariableEditor] = useState(\n null,\n );\n\n const [shouldPersistHeaders, setShouldPersistHeadersInternal] = useState(\n () => {\n const isStored = storage?.get(PERSIST_HEADERS_STORAGE_KEY) !== null;\n return props.shouldPersistHeaders !== false && isStored\n ? storage?.get(PERSIST_HEADERS_STORAGE_KEY) === 'true'\n : Boolean(props.shouldPersistHeaders);\n },\n );\n\n useSynchronizeValue(headerEditor, props.headers);\n useSynchronizeValue(queryEditor, props.query);\n useSynchronizeValue(responseEditor, props.response);\n useSynchronizeValue(variableEditor, props.variables);\n\n const storeTabs = useStoreTabs({\n storage,\n shouldPersistHeaders,\n });\n\n // We store this in state but never update it. By passing a function we only\n // need to compute it lazily during the initial render.\n const [initialState] = useState(() => {\n const query = props.query ?? storage?.get(STORAGE_KEY_QUERY) ?? null;\n const variables =\n props.variables ?? storage?.get(STORAGE_KEY_VARIABLES) ?? null;\n const headers = props.headers ?? storage?.get(STORAGE_KEY_HEADERS) ?? null;\n const response = props.response ?? '';\n\n const tabState = getDefaultTabState({\n query,\n variables,\n headers,\n defaultTabs: props.defaultTabs || props.initialTabs,\n defaultQuery: props.defaultQuery || DEFAULT_QUERY,\n defaultHeaders: props.defaultHeaders,\n storage,\n });\n storeTabs(tabState);\n\n return {\n query:\n query ??\n (tabState.activeTabIndex === 0 ? tabState.tabs[0].query : null) ??\n '',\n variables: variables ?? '',\n headers: headers ?? props.defaultHeaders ?? '',\n response,\n tabState,\n };\n });\n\n const [tabState, setTabState] = useState(initialState.tabState);\n\n const setShouldPersistHeaders = useCallback(\n (persist: boolean) => {\n if (persist) {\n storage?.set(STORAGE_KEY_HEADERS, headerEditor?.getValue() ?? '');\n const serializedTabs = serializeTabState(tabState, true);\n storage?.set(STORAGE_KEY_TABS, serializedTabs);\n } else {\n storage?.set(STORAGE_KEY_HEADERS, '');\n clearHeadersFromTabs(storage);\n }\n setShouldPersistHeadersInternal(persist);\n storage?.set(PERSIST_HEADERS_STORAGE_KEY, persist.toString());\n },\n [storage, tabState, headerEditor],\n );\n\n const lastShouldPersistHeadersProp = useRef(undefined);\n useEffect(() => {\n const propValue = Boolean(props.shouldPersistHeaders);\n if (lastShouldPersistHeadersProp.current !== propValue) {\n setShouldPersistHeaders(propValue);\n lastShouldPersistHeadersProp.current = propValue;\n }\n }, [props.shouldPersistHeaders, setShouldPersistHeaders]);\n\n const synchronizeActiveTabValues = useSynchronizeActiveTabValues({\n queryEditor,\n variableEditor,\n headerEditor,\n responseEditor,\n });\n const setEditorValues = useSetEditorValues({\n queryEditor,\n variableEditor,\n headerEditor,\n responseEditor,\n });\n const { onTabChange, defaultHeaders, children } = props;\n\n const addTab = useCallback(() => {\n setTabState(current => {\n // Make sure the current tab stores the latest values\n const updatedValues = synchronizeActiveTabValues(current);\n const updated = {\n tabs: [...updatedValues.tabs, createTab({ headers: defaultHeaders })],\n activeTabIndex: updatedValues.tabs.length,\n };\n storeTabs(updated);\n setEditorValues(updated.tabs[updated.activeTabIndex]);\n onTabChange?.(updated);\n return updated;\n });\n }, [\n defaultHeaders,\n onTabChange,\n setEditorValues,\n storeTabs,\n synchronizeActiveTabValues,\n ]);\n\n const changeTab = useCallback(\n index => {\n setTabState(current => {\n const updated = {\n ...synchronizeActiveTabValues(current),\n activeTabIndex: index,\n };\n storeTabs(updated);\n setEditorValues(updated.tabs[updated.activeTabIndex]);\n onTabChange?.(updated);\n return updated;\n });\n },\n [onTabChange, setEditorValues, storeTabs, synchronizeActiveTabValues],\n );\n\n const closeTab = useCallback(\n index => {\n setTabState(current => {\n const updated = {\n tabs: current.tabs.filter((_tab, i) => index !== i),\n activeTabIndex: Math.max(current.activeTabIndex - 1, 0),\n };\n storeTabs(updated);\n setEditorValues(updated.tabs[updated.activeTabIndex]);\n onTabChange?.(updated);\n return updated;\n });\n },\n [onTabChange, setEditorValues, storeTabs],\n );\n\n const updateActiveTabValues = useCallback<\n EditorContextType['updateActiveTabValues']\n >(\n partialTab => {\n setTabState(current => {\n const updated = setPropertiesInActiveTab(current, partialTab);\n storeTabs(updated);\n onTabChange?.(updated);\n return updated;\n });\n },\n [onTabChange, storeTabs],\n );\n\n const { onEditOperationName } = props;\n const setOperationName = useCallback(\n operationName => {\n if (!queryEditor) {\n return;\n }\n\n queryEditor.operationName = operationName;\n updateActiveTabValues({ operationName });\n onEditOperationName?.(operationName);\n },\n [onEditOperationName, queryEditor, updateActiveTabValues],\n );\n\n const externalFragments = useMemo(() => {\n const map = new Map();\n if (Array.isArray(props.externalFragments)) {\n for (const fragment of props.externalFragments) {\n map.set(fragment.name.value, fragment);\n }\n } else if (typeof props.externalFragments === 'string') {\n visit(parse(props.externalFragments, {}), {\n FragmentDefinition(fragment) {\n map.set(fragment.name.value, fragment);\n },\n });\n } else if (props.externalFragments) {\n throw new Error(\n 'The `externalFragments` prop must either be a string that contains the fragment definitions in SDL or a list of FragmentDefinitionNode objects.',\n );\n }\n return map;\n }, [props.externalFragments]);\n\n const validationRules = useMemo(\n () => props.validationRules || [],\n [props.validationRules],\n );\n\n const value = useMemo(\n () => ({\n ...tabState,\n addTab,\n changeTab,\n closeTab,\n updateActiveTabValues,\n\n headerEditor,\n queryEditor,\n responseEditor,\n variableEditor,\n setHeaderEditor,\n setQueryEditor,\n setResponseEditor,\n setVariableEditor,\n\n setOperationName,\n\n initialQuery: initialState.query,\n initialVariables: initialState.variables,\n initialHeaders: initialState.headers,\n initialResponse: initialState.response,\n\n externalFragments,\n validationRules,\n\n shouldPersistHeaders,\n setShouldPersistHeaders,\n }),\n [\n tabState,\n addTab,\n changeTab,\n closeTab,\n updateActiveTabValues,\n\n headerEditor,\n queryEditor,\n responseEditor,\n variableEditor,\n\n setOperationName,\n\n initialState,\n\n externalFragments,\n validationRules,\n\n shouldPersistHeaders,\n setShouldPersistHeaders,\n ],\n );\n\n return (\n {children}\n );\n}\n\nexport const useEditorContext = createContextHook(EditorContext);\n\nconst PERSIST_HEADERS_STORAGE_KEY = 'shouldPersistHeaders';\n\nconst DEFAULT_QUERY = `# Welcome to GraphiQL\n#\n# GraphiQL is an in-browser tool for writing, validating, and\n# testing GraphQL queries.\n#\n# Type queries into this side of the screen, and you will see intelligent\n# typeaheads aware of the current GraphQL type schema and live syntax and\n# validation errors highlighted within the text.\n#\n# GraphQL queries typically start with a \"{\" character. Lines that start\n# with a # are ignored.\n#\n# An example GraphQL query might look like:\n#\n# {\n# field(arg: \"value\") {\n# subField\n# }\n# }\n#\n# Keyboard shortcuts:\n#\n# Prettify query: Shift-Ctrl-P (or press the prettify button)\n#\n# Merge fragments: Shift-Ctrl-M (or press the merge button)\n#\n# Run Query: Ctrl-Enter (or press the play button)\n#\n# Auto Complete: Ctrl-Space (or just start typing)\n#\n\n`;\n","import { useEffect } from 'react';\nimport { clsx } from 'clsx';\n\nimport { useEditorContext } from '../context';\nimport { useHeaderEditor, UseHeaderEditorArgs } from '../header-editor';\n\nimport '../style/codemirror.css';\nimport '../style/fold.css';\nimport '../style/editor.css';\n\ntype HeaderEditorProps = UseHeaderEditorArgs & {\n /**\n * Visually hide the header editor.\n * @default false\n */\n isHidden?: boolean;\n};\n\nexport function HeaderEditor({ isHidden, ...hookArgs }: HeaderEditorProps) {\n const { headerEditor } = useEditorContext({\n nonNull: true,\n caller: HeaderEditor,\n });\n const ref = useHeaderEditor(hookArgs, HeaderEditor);\n\n useEffect(() => {\n if (headerEditor && !isHidden) {\n headerEditor.refresh();\n }\n }, [headerEditor, isHidden]);\n\n return (\n
    \n );\n}\n","import type { Token } from 'codemirror';\nimport { useEffect, useRef, useState } from 'react';\n\ntype ImagePreviewProps = { token: Token };\n\ntype Dimensions = {\n width: number | null;\n height: number | null;\n};\n\nexport function ImagePreview(props: ImagePreviewProps) {\n const [dimensions, setDimensions] = useState({\n width: null,\n height: null,\n });\n const [mime, setMime] = useState(null);\n\n const ref = useRef(null);\n\n const src = tokenToURL(props.token)?.href;\n\n useEffect(() => {\n if (!ref.current) {\n return;\n }\n if (!src) {\n setDimensions({ width: null, height: null });\n setMime(null);\n return;\n }\n\n fetch(src, { method: 'HEAD' })\n .then(response => {\n setMime(response.headers.get('Content-Type'));\n })\n .catch(() => {\n setMime(null);\n });\n }, [src]);\n\n const dims =\n dimensions.width !== null && dimensions.height !== null ? (\n
    \n {dimensions.width}x{dimensions.height}\n {mime === null ? null : ' ' + mime}\n
    \n ) : null;\n\n return (\n
    \n {\n setDimensions({\n width: ref.current?.naturalWidth ?? null,\n height: ref.current?.naturalHeight ?? null,\n });\n }}\n ref={ref}\n src={src}\n />\n {dims}\n
    \n );\n}\n\nImagePreview.shouldRender = function shouldRender(token: Token) {\n const url = tokenToURL(token);\n return url ? isImageURL(url) : false;\n};\n\nfunction tokenToURL(token: Token) {\n if (token.type !== 'string') {\n return;\n }\n\n const value = token.string.slice(1).slice(0, -1).trim();\n\n try {\n const { location } = window;\n return new URL(value, location.protocol + '//' + location.host);\n } catch {\n return;\n }\n}\n\nfunction isImageURL(url: URL) {\n return /(bmp|gif|jpeg|jpg|png|svg)$/.test(url.pathname);\n}\n","import { useQueryEditor, UseQueryEditorArgs } from '../query-editor';\n\nimport '../style/codemirror.css';\nimport '../style/fold.css';\nimport '../style/lint.css';\nimport '../style/hint.css';\nimport '../style/info.css';\nimport '../style/jump.css';\nimport '../style/auto-insertion.css';\nimport '../style/editor.css';\n\nexport function QueryEditor(props: UseQueryEditorArgs) {\n const ref = useQueryEditor(props, QueryEditor);\n return
    ;\n}\n","import { formatError } from '@graphiql/toolkit';\nimport type { Position, Token } from 'codemirror';\nimport { ComponentType, useEffect, useRef } from 'react';\nimport ReactDOM from 'react-dom';\nimport { useSchemaContext } from '../schema';\n\nimport {\n commonKeys,\n DEFAULT_EDITOR_THEME,\n DEFAULT_KEY_MAP,\n importCodeMirror,\n} from './common';\nimport { ImagePreview } from './components';\nimport { useEditorContext } from './context';\nimport { useSynchronizeOption } from './hooks';\nimport { CodeMirrorEditor, CommonEditorProps } from './types';\n\nexport type ResponseTooltipType = ComponentType<{\n /**\n * The position of the token in the editor contents.\n */\n pos: Position;\n /**\n * The token that has been hovered over.\n */\n token: Token;\n}>;\n\nexport type UseResponseEditorArgs = CommonEditorProps & {\n /**\n * Customize the tooltip when hovering over properties in the response\n * editor.\n */\n responseTooltip?: ResponseTooltipType;\n};\n\nexport function useResponseEditor(\n {\n responseTooltip,\n editorTheme = DEFAULT_EDITOR_THEME,\n keyMap = DEFAULT_KEY_MAP,\n }: UseResponseEditorArgs = {},\n caller?: Function,\n) {\n const { fetchError, validationErrors } = useSchemaContext({\n nonNull: true,\n caller: caller || useResponseEditor,\n });\n const { initialResponse, responseEditor, setResponseEditor } =\n useEditorContext({\n nonNull: true,\n caller: caller || useResponseEditor,\n });\n const ref = useRef(null);\n\n const responseTooltipRef = useRef(\n responseTooltip,\n );\n useEffect(() => {\n responseTooltipRef.current = responseTooltip;\n }, [responseTooltip]);\n\n useEffect(() => {\n let isActive = true;\n importCodeMirror(\n [\n import('codemirror/addon/fold/foldgutter'),\n import('codemirror/addon/fold/brace-fold'),\n import('codemirror/addon/dialog/dialog'),\n import('codemirror/addon/search/search'),\n import('codemirror/addon/search/searchcursor'),\n import('codemirror/addon/search/jump-to-line'),\n // @ts-expect-error\n import('codemirror/keymap/sublime'),\n import('codemirror-graphql/esm/results/mode'),\n import('codemirror-graphql/esm/utils/info-addon'),\n ],\n { useCommonAddons: false },\n ).then(CodeMirror => {\n // Don't continue if the effect has already been cleaned up\n if (!isActive) {\n return;\n }\n\n // Handle image tooltips and custom tooltips\n const tooltipDiv = document.createElement('div');\n CodeMirror.registerHelper(\n 'info',\n 'graphql-results',\n (token: Token, _options: any, _cm: CodeMirrorEditor, pos: Position) => {\n const infoElements: JSX.Element[] = [];\n\n const ResponseTooltipComponent = responseTooltipRef.current;\n if (ResponseTooltipComponent) {\n infoElements.push(\n ,\n );\n }\n\n if (ImagePreview.shouldRender(token)) {\n infoElements.push(\n ,\n );\n }\n\n if (!infoElements.length) {\n ReactDOM.unmountComponentAtNode(tooltipDiv);\n return null;\n }\n ReactDOM.render(infoElements, tooltipDiv);\n return tooltipDiv;\n },\n );\n\n const container = ref.current;\n if (!container) {\n return;\n }\n\n const newEditor = CodeMirror(container, {\n value: initialResponse,\n lineWrapping: true,\n readOnly: true,\n theme: editorTheme,\n mode: 'graphql-results',\n foldGutter: true,\n gutters: ['CodeMirror-foldgutter'],\n // @ts-expect-error\n info: true,\n extraKeys: commonKeys,\n });\n\n setResponseEditor(newEditor);\n });\n\n return () => {\n isActive = false;\n };\n }, [editorTheme, initialResponse, setResponseEditor]);\n\n useSynchronizeOption(responseEditor, 'keyMap', keyMap);\n\n useEffect(() => {\n if (fetchError) {\n responseEditor?.setValue(fetchError);\n }\n if (validationErrors.length > 0) {\n responseEditor?.setValue(formatError(validationErrors));\n }\n }, [responseEditor, fetchError, validationErrors]);\n\n return ref;\n}\n","import { useResponseEditor, UseResponseEditorArgs } from '../response-editor';\n\nimport '../style/codemirror.css';\nimport '../style/fold.css';\nimport '../style/info.css';\nimport '../style/editor.css';\n\nexport function ResponseEditor(props: UseResponseEditorArgs) {\n const ref = useResponseEditor(props, ResponseEditor);\n return (\n \n );\n}\n","import { useEffect } from 'react';\nimport { clsx } from 'clsx';\n\nimport { useEditorContext } from '../context';\nimport { useVariableEditor, UseVariableEditorArgs } from '../variable-editor';\n\nimport '../style/codemirror.css';\nimport '../style/fold.css';\nimport '../style/lint.css';\nimport '../style/hint.css';\nimport '../style/editor.css';\n\ntype VariableEditorProps = UseVariableEditorArgs & {\n /**\n * Visually hide the header editor.\n * @default false\n */\n isHidden?: boolean;\n};\n\nexport function VariableEditor({ isHidden, ...hookArgs }: VariableEditorProps) {\n const { variableEditor } = useEditorContext({\n nonNull: true,\n caller: VariableEditor,\n });\n const ref = useVariableEditor(hookArgs, VariableEditor);\n\n useEffect(() => {\n if (variableEditor && !isHidden) {\n variableEditor.refresh();\n }\n }, [variableEditor, isHidden]);\n\n return (\n
    \n );\n}\n","import { EditorContextProvider, EditorContextProviderProps } from './editor';\nimport {\n ExecutionContextProvider,\n ExecutionContextProviderProps,\n} from './execution';\nimport {\n ExplorerContextProvider,\n ExplorerContextProviderProps,\n} from './explorer/context';\nimport { HistoryContextProvider, HistoryContextProviderProps } from './history';\nimport { PluginContextProvider, PluginContextProviderProps } from './plugin';\nimport { SchemaContextProvider, SchemaContextProviderProps } from './schema';\nimport { StorageContextProvider, StorageContextProviderProps } from './storage';\n\nexport type GraphiQLProviderProps = EditorContextProviderProps &\n ExecutionContextProviderProps &\n ExplorerContextProviderProps &\n HistoryContextProviderProps &\n PluginContextProviderProps &\n SchemaContextProviderProps &\n StorageContextProviderProps;\n\nexport function GraphiQLProvider({\n children,\n dangerouslyAssumeSchemaIsValid,\n defaultQuery,\n defaultHeaders,\n defaultTabs,\n externalFragments,\n fetcher,\n getDefaultFieldNames,\n headers,\n initialTabs,\n inputValueDeprecation,\n introspectionQueryName,\n maxHistoryLength,\n onEditOperationName,\n onSchemaChange,\n onTabChange,\n onTogglePluginVisibility,\n operationName,\n plugins,\n query,\n response,\n schema,\n schemaDescription,\n shouldPersistHeaders,\n storage,\n validationRules,\n variables,\n visiblePlugin,\n}: GraphiQLProviderProps) {\n return (\n \n \n \n \n \n \n \n {children}\n \n \n \n \n \n \n \n );\n}\n","import { useCallback, useLayoutEffect, useMemo, useState } from 'react';\nimport { useStorageContext } from './storage';\n\n/**\n * The value `null` semantically means that the user does not explicitly choose\n * any theme, so we use the system default.\n */\nexport type Theme = 'light' | 'dark' | null;\n\nexport function useTheme() {\n const storageContext = useStorageContext();\n\n const [theme, setThemeInternal] = useState(() => {\n if (!storageContext) {\n return null;\n }\n\n const stored = storageContext.get(STORAGE_KEY);\n switch (stored) {\n case 'light':\n return 'light';\n case 'dark':\n return 'dark';\n default:\n if (typeof stored === 'string') {\n // Remove the invalid stored value\n storageContext.set(STORAGE_KEY, '');\n }\n return null;\n }\n });\n\n useLayoutEffect(() => {\n if (typeof window === 'undefined') {\n return;\n }\n\n document.body.classList.remove('graphiql-light', 'graphiql-dark');\n if (theme) {\n document.body.classList.add(`graphiql-${theme}`);\n }\n }, [theme]);\n\n const setTheme = useCallback(\n (newTheme: Theme) => {\n storageContext?.set(STORAGE_KEY, newTheme || '');\n setThemeInternal(newTheme);\n },\n [storageContext],\n );\n\n return useMemo(() => ({ theme, setTheme }), [theme, setTheme]);\n}\n\nconst STORAGE_KEY = 'theme';\n","import {\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { useStorageContext } from '../storage';\nimport debounce from './debounce';\n\ntype ResizableElement = 'first' | 'second';\n\ntype UseDragResizeArgs = {\n /**\n * Set the default sizes for the two resizable halves by passing their ratio\n * (first divided by second).\n */\n defaultSizeRelation?: number;\n /**\n * The direction in which the two halves should be resizable.\n */\n direction: 'horizontal' | 'vertical';\n /**\n * Choose one of the two halves that should initially be hidden.\n */\n initiallyHidden?: ResizableElement;\n /**\n * Invoked when the visibility of one of the halves changes.\n * @param hiddenElement The element that is now hidden after the change\n * (`null` if both are visible).\n */\n onHiddenElementChange?(hiddenElement: ResizableElement | null): void;\n /**\n * The minimum width in pixels for the first half. If it is resized to a\n * width smaller than this threshold, the half will be hidden.\n */\n sizeThresholdFirst?: number;\n /**\n * The minimum width in pixels for the second half. If it is resized to a\n * width smaller than this threshold, the half will be hidden.\n */\n sizeThresholdSecond?: number;\n /**\n * A key for which the state of resizing is persisted in storage (if storage\n * is available).\n */\n storageKey?: string;\n};\n\nexport function useDragResize({\n defaultSizeRelation = DEFAULT_FLEX,\n direction,\n initiallyHidden,\n onHiddenElementChange,\n sizeThresholdFirst = 100,\n sizeThresholdSecond = 100,\n storageKey,\n}: UseDragResizeArgs) {\n const storage = useStorageContext();\n\n const store = useMemo(\n () =>\n debounce(500, (value: string) => {\n if (storage && storageKey) {\n storage.set(storageKey, value);\n }\n }),\n [storage, storageKey],\n );\n\n const [hiddenElement, setHiddenElement] = useState(\n () => {\n const storedValue =\n storage && storageKey ? storage.get(storageKey) : null;\n if (storedValue === HIDE_FIRST || initiallyHidden === 'first') {\n return 'first';\n }\n if (storedValue === HIDE_SECOND || initiallyHidden === 'second') {\n return 'second';\n }\n return null;\n },\n );\n\n const setHiddenElementWithCallback = useCallback(\n (element: ResizableElement | null) => {\n if (element !== hiddenElement) {\n setHiddenElement(element);\n onHiddenElementChange?.(element);\n }\n },\n [hiddenElement, onHiddenElementChange],\n );\n\n const firstRef = useRef(null);\n const dragBarRef = useRef(null);\n const secondRef = useRef(null);\n\n const defaultFlexRef = useRef(`${defaultSizeRelation}`);\n\n /**\n * Set initial flex values\n */\n useLayoutEffect(() => {\n const storedValue =\n storage && storageKey\n ? storage.get(storageKey) || defaultFlexRef.current\n : defaultFlexRef.current;\n const flexDirection = direction === 'horizontal' ? 'row' : 'column';\n\n if (firstRef.current) {\n firstRef.current.style.display = 'flex';\n firstRef.current.style.flexDirection = flexDirection;\n firstRef.current.style.flex =\n storedValue === HIDE_FIRST || storedValue === HIDE_SECOND\n ? defaultFlexRef.current\n : storedValue;\n }\n\n if (secondRef.current) {\n secondRef.current.style.display = 'flex';\n secondRef.current.style.flexDirection = flexDirection;\n secondRef.current.style.flex = '1';\n }\n\n if (dragBarRef.current) {\n dragBarRef.current.style.display = 'flex';\n dragBarRef.current.style.flexDirection = flexDirection;\n }\n }, [direction, storage, storageKey]);\n\n const hide = useCallback((resizableElement: ResizableElement) => {\n const element =\n resizableElement === 'first' ? firstRef.current : secondRef.current;\n if (!element) {\n return;\n }\n\n // We hide elements off screen because of codemirror. If the page is loaded\n // and the codemirror container would have zero width, the layout isn't\n // instant pretty. By always giving the editor some width we avoid any\n // layout shifts when the editor reappears.\n element.style.left = '-1000px';\n element.style.position = 'absolute';\n element.style.opacity = '0';\n element.style.height = '500px';\n element.style.width = '500px';\n\n // Make sure that the flex value of the first item is at least equal to one\n // so that the entire space of the parent element is filled up\n if (firstRef.current) {\n const flex = parseFloat(firstRef.current.style.flex);\n if (!Number.isFinite(flex) || flex < 1) {\n firstRef.current.style.flex = '1';\n }\n }\n }, []);\n\n const show = useCallback(\n (resizableElement: ResizableElement) => {\n const element =\n resizableElement === 'first' ? firstRef.current : secondRef.current;\n if (!element) {\n return;\n }\n\n element.style.width = '';\n element.style.height = '';\n element.style.opacity = '';\n element.style.position = '';\n element.style.left = '';\n\n if (firstRef.current && storage && storageKey) {\n const storedValue = storage?.get(storageKey);\n if (storedValue !== HIDE_FIRST && storedValue !== HIDE_SECOND) {\n firstRef.current.style.flex = storedValue || defaultFlexRef.current;\n }\n }\n },\n [storage, storageKey],\n );\n\n /**\n * Hide and show items when state changes\n */\n useLayoutEffect(() => {\n if (hiddenElement === 'first') {\n hide('first');\n } else {\n show('first');\n }\n if (hiddenElement === 'second') {\n hide('second');\n } else {\n show('second');\n }\n }, [hiddenElement, hide, show]);\n\n useEffect(() => {\n if (!dragBarRef.current || !firstRef.current || !secondRef.current) {\n return;\n }\n const dragBarContainer = dragBarRef.current;\n const firstContainer = firstRef.current;\n const wrapper = firstContainer.parentElement!;\n\n const eventProperty = direction === 'horizontal' ? 'clientX' : 'clientY';\n const rectProperty = direction === 'horizontal' ? 'left' : 'top';\n const adjacentRectProperty =\n direction === 'horizontal' ? 'right' : 'bottom';\n const sizeProperty =\n direction === 'horizontal' ? 'clientWidth' : 'clientHeight';\n\n function handleMouseDown(downEvent: MouseEvent) {\n downEvent.preventDefault();\n\n // Distance between the start of the drag bar and the exact point where\n // the user clicked on the drag bar.\n const offset =\n downEvent[eventProperty] -\n dragBarContainer.getBoundingClientRect()[rectProperty];\n\n function handleMouseMove(moveEvent: MouseEvent) {\n if (moveEvent.buttons === 0) {\n return handleMouseUp();\n }\n\n const firstSize =\n moveEvent[eventProperty] -\n wrapper.getBoundingClientRect()[rectProperty] -\n offset;\n const secondSize =\n wrapper.getBoundingClientRect()[adjacentRectProperty] -\n moveEvent[eventProperty] +\n offset -\n dragBarContainer[sizeProperty];\n\n if (firstSize < sizeThresholdFirst) {\n // Hide the first display\n setHiddenElementWithCallback('first');\n store(HIDE_FIRST);\n } else if (secondSize < sizeThresholdSecond) {\n // Hide the second display\n setHiddenElementWithCallback('second');\n store(HIDE_SECOND);\n } else {\n // Show both and adjust the flex value of the first one (the flex\n // value for the second one is always `1`)\n setHiddenElementWithCallback(null);\n const newFlex = `${firstSize / secondSize}`;\n firstContainer.style.flex = newFlex;\n store(newFlex);\n }\n }\n\n function handleMouseUp() {\n document.removeEventListener('mousemove', handleMouseMove);\n document.removeEventListener('mouseup', handleMouseUp);\n }\n\n document.addEventListener('mousemove', handleMouseMove);\n document.addEventListener('mouseup', handleMouseUp);\n }\n\n dragBarContainer.addEventListener('mousedown', handleMouseDown);\n\n function reset() {\n if (firstRef.current) {\n firstRef.current.style.flex = defaultFlexRef.current;\n }\n store(defaultFlexRef.current);\n setHiddenElementWithCallback(null);\n }\n\n dragBarContainer.addEventListener('dblclick', reset);\n\n return () => {\n dragBarContainer.removeEventListener('mousedown', handleMouseDown);\n dragBarContainer.removeEventListener('dblclick', reset);\n };\n }, [\n direction,\n setHiddenElementWithCallback,\n sizeThresholdFirst,\n sizeThresholdSecond,\n store,\n ]);\n\n return useMemo(\n () => ({\n dragBarRef,\n hiddenElement,\n firstRef,\n setHiddenElement,\n secondRef,\n }),\n [hiddenElement, setHiddenElement],\n );\n}\n\nconst DEFAULT_FLEX = 1;\nconst HIDE_FIRST = 'hide-first';\nconst HIDE_SECOND = 'hide-second';\n","import { forwardRef, useState } from 'react';\nimport { clsx } from 'clsx';\nimport { Tooltip, UnStyledButton } from '../ui';\n\nimport './button.css';\n\ntype ToolbarButtonProps = {\n label: string;\n};\n\nexport const ToolbarButton = forwardRef<\n HTMLButtonElement,\n ToolbarButtonProps & JSX.IntrinsicElements['button']\n>(({ label, ...props }, ref) => {\n const [error, setError] = useState(null);\n return (\n \n {\n try {\n props.onClick?.(event);\n setError(null);\n } catch (err) {\n setError(\n err instanceof Error\n ? err\n : new Error(`Toolbar button click failed: ${err}`),\n );\n }\n }}\n aria-label={error ? error.message : label}\n aria-invalid={error ? 'true' : props['aria-invalid']}\n />\n \n );\n});\nToolbarButton.displayName = 'ToolbarButton';\n","import { useEditorContext } from '../editor';\nimport { useExecutionContext } from '../execution';\nimport { PlayIcon, StopIcon } from '../icons';\nimport { Menu, Tooltip } from '../ui';\n\nimport './execute.css';\n\nexport function ExecuteButton() {\n const { queryEditor, setOperationName } = useEditorContext({\n nonNull: true,\n caller: ExecuteButton,\n });\n const { isFetching, isSubscribed, operationName, run, stop } =\n useExecutionContext({\n nonNull: true,\n caller: ExecuteButton,\n });\n\n const operations = queryEditor?.operations || [];\n const hasOptions = operations.length > 1 && typeof operationName !== 'string';\n const isRunning = isFetching || isSubscribed;\n\n const label = `${isRunning ? 'Stop' : 'Execute'} query (Ctrl-Enter)`;\n const buttonProps = {\n type: 'button' as const,\n className: 'graphiql-execute-button',\n children: isRunning ? : ,\n 'aria-label': label,\n };\n\n return hasOptions && !isRunning ? (\n \n \n \n \n\n \n {operations.map((operation, i) => {\n const opName = operation.name\n ? operation.name.value\n : ``;\n return (\n {\n const selectedOperationName = operation.name?.value;\n if (\n queryEditor &&\n selectedOperationName &&\n selectedOperationName !== queryEditor.operationName\n ) {\n setOperationName(selectedOperationName);\n }\n run();\n }}\n >\n {opName}\n \n );\n })}\n \n \n ) : (\n \n {\n if (isRunning) {\n stop();\n } else {\n run();\n }\n }}\n />\n \n );\n}\n","import { ComponentProps, forwardRef, ReactNode } from 'react';\nimport { clsx } from 'clsx';\nimport { Listbox, Tooltip } from '../ui';\nimport { createComponentGroup } from '../utility/component-group';\n\nimport './listbox.css';\n\ntype ToolbarListboxProps = {\n button: ReactNode;\n label: string;\n};\n\nconst ToolbarListboxRoot = forwardRef<\n HTMLDivElement,\n ToolbarListboxProps & ComponentProps\n>(({ button, children, label, ...props }, ref) => {\n const labelWithValue = `${label}${props.value ? `: ${props.value}` : ''}`;\n return (\n \n \n {button}\n \n {children}\n \n );\n});\nToolbarListboxRoot.displayName = 'ToolbarListbox';\n\nexport const ToolbarListbox = createComponentGroup(ToolbarListboxRoot, {\n Option: Listbox.Option,\n});\n","import { forwardRef, ReactNode } from 'react';\nimport { clsx } from 'clsx';\nimport { Menu, Tooltip } from '../ui';\nimport { createComponentGroup } from '../utility/component-group';\n\nimport './menu.css';\n\ntype ToolbarMenuProps = {\n button: ReactNode;\n label: string;\n};\n\nconst ToolbarMenuRoot = forwardRef<\n HTMLDivElement,\n ToolbarMenuProps & JSX.IntrinsicElements['div']\n>(({ button, children, label, ...props }, ref) => (\n \n \n \n {button}\n \n \n {children}\n \n));\nToolbarMenuRoot.displayName = 'ToolbarMenu';\n\nexport const ToolbarMenu = createComponentGroup(ToolbarMenuRoot, {\n Item: Menu.Item,\n});\n","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"m10 17 5-5-5-5v10z\"\n}), 'ArrowRight');\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n}), 'Close');\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z\"\n}), 'Download');\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z\"\n}), 'ExpandMore');\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\nvar _jsxRuntime = require(\"react/jsx-runtime\");\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)(\"path\", {\n d: \"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z\"\n}), 'Launch');\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"default\", {\n enumerable: true,\n get: function () {\n return _utils.createSvgIcon;\n }\n});\nvar _utils = require(\"@mui/material/utils\");","/**\n * @license React\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var b=Symbol.for(\"react.element\"),c=Symbol.for(\"react.portal\"),d=Symbol.for(\"react.fragment\"),e=Symbol.for(\"react.strict_mode\"),f=Symbol.for(\"react.profiler\"),g=Symbol.for(\"react.provider\"),h=Symbol.for(\"react.context\"),k=Symbol.for(\"react.server_context\"),l=Symbol.for(\"react.forward_ref\"),m=Symbol.for(\"react.suspense\"),n=Symbol.for(\"react.suspense_list\"),p=Symbol.for(\"react.memo\"),q=Symbol.for(\"react.lazy\"),t=Symbol.for(\"react.offscreen\"),u;u=Symbol.for(\"react.module.reference\");\nfunction v(a){if(\"object\"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}exports.ContextConsumer=h;exports.ContextProvider=g;exports.Element=b;exports.ForwardRef=l;exports.Fragment=d;exports.Lazy=q;exports.Memo=p;exports.Portal=c;exports.Profiler=f;exports.StrictMode=e;exports.Suspense=m;\nexports.SuspenseList=n;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return v(a)===h};exports.isContextProvider=function(a){return v(a)===g};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return v(a)===l};exports.isFragment=function(a){return v(a)===d};exports.isLazy=function(a){return v(a)===q};exports.isMemo=function(a){return v(a)===p};\nexports.isPortal=function(a){return v(a)===c};exports.isProfiler=function(a){return v(a)===f};exports.isStrictMode=function(a){return v(a)===e};exports.isSuspense=function(a){return v(a)===m};exports.isSuspenseList=function(a){return v(a)===n};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||\"object\"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};exports.typeOf=v;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nexport default function createMixins(breakpoints, mixins) {\n return _extends({\n toolbar: {\n minHeight: 56,\n [breakpoints.up('xs')]: {\n '@media (orientation: landscape)': {\n minHeight: 48\n }\n },\n [breakpoints.up('sm')]: {\n minHeight: 64\n }\n }\n }, mixins);\n}","const common = {\n black: '#000',\n white: '#fff'\n};\nexport default common;","const grey = {\n 50: '#fafafa',\n 100: '#f5f5f5',\n 200: '#eeeeee',\n 300: '#e0e0e0',\n 400: '#bdbdbd',\n 500: '#9e9e9e',\n 600: '#757575',\n 700: '#616161',\n 800: '#424242',\n 900: '#212121',\n A100: '#f5f5f5',\n A200: '#eeeeee',\n A400: '#bdbdbd',\n A700: '#616161'\n};\nexport default grey;","const purple = {\n 50: '#f3e5f5',\n 100: '#e1bee7',\n 200: '#ce93d8',\n 300: '#ba68c8',\n 400: '#ab47bc',\n 500: '#9c27b0',\n 600: '#8e24aa',\n 700: '#7b1fa2',\n 800: '#6a1b9a',\n 900: '#4a148c',\n A100: '#ea80fc',\n A200: '#e040fb',\n A400: '#d500f9',\n A700: '#aa00ff'\n};\nexport default purple;","const red = {\n 50: '#ffebee',\n 100: '#ffcdd2',\n 200: '#ef9a9a',\n 300: '#e57373',\n 400: '#ef5350',\n 500: '#f44336',\n 600: '#e53935',\n 700: '#d32f2f',\n 800: '#c62828',\n 900: '#b71c1c',\n A100: '#ff8a80',\n A200: '#ff5252',\n A400: '#ff1744',\n A700: '#d50000'\n};\nexport default red;","const orange = {\n 50: '#fff3e0',\n 100: '#ffe0b2',\n 200: '#ffcc80',\n 300: '#ffb74d',\n 400: '#ffa726',\n 500: '#ff9800',\n 600: '#fb8c00',\n 700: '#f57c00',\n 800: '#ef6c00',\n 900: '#e65100',\n A100: '#ffd180',\n A200: '#ffab40',\n A400: '#ff9100',\n A700: '#ff6d00'\n};\nexport default orange;","const blue = {\n 50: '#e3f2fd',\n 100: '#bbdefb',\n 200: '#90caf9',\n 300: '#64b5f6',\n 400: '#42a5f5',\n 500: '#2196f3',\n 600: '#1e88e5',\n 700: '#1976d2',\n 800: '#1565c0',\n 900: '#0d47a1',\n A100: '#82b1ff',\n A200: '#448aff',\n A400: '#2979ff',\n A700: '#2962ff'\n};\nexport default blue;","const lightBlue = {\n 50: '#e1f5fe',\n 100: '#b3e5fc',\n 200: '#81d4fa',\n 300: '#4fc3f7',\n 400: '#29b6f6',\n 500: '#03a9f4',\n 600: '#039be5',\n 700: '#0288d1',\n 800: '#0277bd',\n 900: '#01579b',\n A100: '#80d8ff',\n A200: '#40c4ff',\n A400: '#00b0ff',\n A700: '#0091ea'\n};\nexport default lightBlue;","const green = {\n 50: '#e8f5e9',\n 100: '#c8e6c9',\n 200: '#a5d6a7',\n 300: '#81c784',\n 400: '#66bb6a',\n 500: '#4caf50',\n 600: '#43a047',\n 700: '#388e3c',\n 800: '#2e7d32',\n 900: '#1b5e20',\n A100: '#b9f6ca',\n A200: '#69f0ae',\n A400: '#00e676',\n A700: '#00c853'\n};\nexport default green;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport { formatMuiErrorMessage as _formatMuiErrorMessage } from \"@mui/utils\";\nconst _excluded = [\"mode\", \"contrastThreshold\", \"tonalOffset\"];\nimport { deepmerge } from '@mui/utils';\nimport { darken, getContrastRatio, lighten } from '@mui/system';\nimport common from '../colors/common';\nimport grey from '../colors/grey';\nimport purple from '../colors/purple';\nimport red from '../colors/red';\nimport orange from '../colors/orange';\nimport blue from '../colors/blue';\nimport lightBlue from '../colors/lightBlue';\nimport green from '../colors/green';\nexport const light = {\n // The colors used to style the text.\n text: {\n // The most important text.\n primary: 'rgba(0, 0, 0, 0.87)',\n // Secondary text.\n secondary: 'rgba(0, 0, 0, 0.6)',\n // Disabled text have even lower visual prominence.\n disabled: 'rgba(0, 0, 0, 0.38)'\n },\n // The color used to divide different elements.\n divider: 'rgba(0, 0, 0, 0.12)',\n // The background colors used to style the surfaces.\n // Consistency between these values is important.\n background: {\n paper: common.white,\n default: common.white\n },\n // The colors used to style the action elements.\n action: {\n // The color of an active action like an icon button.\n active: 'rgba(0, 0, 0, 0.54)',\n // The color of an hovered action.\n hover: 'rgba(0, 0, 0, 0.04)',\n hoverOpacity: 0.04,\n // The color of a selected action.\n selected: 'rgba(0, 0, 0, 0.08)',\n selectedOpacity: 0.08,\n // The color of a disabled action.\n disabled: 'rgba(0, 0, 0, 0.26)',\n // The background color of a disabled action.\n disabledBackground: 'rgba(0, 0, 0, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(0, 0, 0, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.12\n }\n};\nexport const dark = {\n text: {\n primary: common.white,\n secondary: 'rgba(255, 255, 255, 0.7)',\n disabled: 'rgba(255, 255, 255, 0.5)',\n icon: 'rgba(255, 255, 255, 0.5)'\n },\n divider: 'rgba(255, 255, 255, 0.12)',\n background: {\n paper: '#121212',\n default: '#121212'\n },\n action: {\n active: common.white,\n hover: 'rgba(255, 255, 255, 0.08)',\n hoverOpacity: 0.08,\n selected: 'rgba(255, 255, 255, 0.16)',\n selectedOpacity: 0.16,\n disabled: 'rgba(255, 255, 255, 0.3)',\n disabledBackground: 'rgba(255, 255, 255, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(255, 255, 255, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.24\n }\n};\nfunction addLightOrDark(intent, direction, shade, tonalOffset) {\n const tonalOffsetLight = tonalOffset.light || tonalOffset;\n const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;\n if (!intent[direction]) {\n if (intent.hasOwnProperty(shade)) {\n intent[direction] = intent[shade];\n } else if (direction === 'light') {\n intent.light = lighten(intent.main, tonalOffsetLight);\n } else if (direction === 'dark') {\n intent.dark = darken(intent.main, tonalOffsetDark);\n }\n }\n}\nfunction getDefaultPrimary(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: blue[200],\n light: blue[50],\n dark: blue[400]\n };\n }\n return {\n main: blue[700],\n light: blue[400],\n dark: blue[800]\n };\n}\nfunction getDefaultSecondary(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: purple[200],\n light: purple[50],\n dark: purple[400]\n };\n }\n return {\n main: purple[500],\n light: purple[300],\n dark: purple[700]\n };\n}\nfunction getDefaultError(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: red[500],\n light: red[300],\n dark: red[700]\n };\n }\n return {\n main: red[700],\n light: red[400],\n dark: red[800]\n };\n}\nfunction getDefaultInfo(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: lightBlue[400],\n light: lightBlue[300],\n dark: lightBlue[700]\n };\n }\n return {\n main: lightBlue[700],\n light: lightBlue[500],\n dark: lightBlue[900]\n };\n}\nfunction getDefaultSuccess(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: green[400],\n light: green[300],\n dark: green[700]\n };\n }\n return {\n main: green[800],\n light: green[500],\n dark: green[900]\n };\n}\nfunction getDefaultWarning(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: orange[400],\n light: orange[300],\n dark: orange[700]\n };\n }\n return {\n main: '#ed6c02',\n // closest to orange[800] that pass 3:1.\n light: orange[500],\n dark: orange[900]\n };\n}\nexport default function createPalette(palette) {\n const {\n mode = 'light',\n contrastThreshold = 3,\n tonalOffset = 0.2\n } = palette,\n other = _objectWithoutPropertiesLoose(palette, _excluded);\n const primary = palette.primary || getDefaultPrimary(mode);\n const secondary = palette.secondary || getDefaultSecondary(mode);\n const error = palette.error || getDefaultError(mode);\n const info = palette.info || getDefaultInfo(mode);\n const success = palette.success || getDefaultSuccess(mode);\n const warning = palette.warning || getDefaultWarning(mode);\n\n // Use the same logic as\n // Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59\n // and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54\n function getContrastText(background) {\n const contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;\n if (process.env.NODE_ENV !== 'production') {\n const contrast = getContrastRatio(background, contrastText);\n if (contrast < 3) {\n console.error([`MUI: The contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`, 'falls below the WCAG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\\n'));\n }\n }\n return contrastText;\n }\n const augmentColor = ({\n color,\n name,\n mainShade = 500,\n lightShade = 300,\n darkShade = 700\n }) => {\n color = _extends({}, color);\n if (!color.main && color[mainShade]) {\n color.main = color[mainShade];\n }\n if (!color.hasOwnProperty('main')) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\nThe color object needs to have a \\`main\\` property or a \\`${mainShade}\\` property.` : _formatMuiErrorMessage(11, name ? ` (${name})` : '', mainShade));\n }\n if (typeof color.main !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n\\`color.main\\` should be a string, but \\`${JSON.stringify(color.main)}\\` was provided instead.\n\nDid you intend to use one of the following approaches?\n\nimport { green } from \"@mui/material/colors\";\n\nconst theme1 = createTheme({ palette: {\n primary: green,\n} });\n\nconst theme2 = createTheme({ palette: {\n primary: { main: green[500] },\n} });` : _formatMuiErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));\n }\n addLightOrDark(color, 'light', lightShade, tonalOffset);\n addLightOrDark(color, 'dark', darkShade, tonalOffset);\n if (!color.contrastText) {\n color.contrastText = getContrastText(color.main);\n }\n return color;\n };\n const modes = {\n dark,\n light\n };\n if (process.env.NODE_ENV !== 'production') {\n if (!modes[mode]) {\n console.error(`MUI: The palette mode \\`${mode}\\` is not supported.`);\n }\n }\n const paletteOutput = deepmerge(_extends({\n // A collection of common colors.\n common: _extends({}, common),\n // prevent mutable object.\n // The palette mode, can be light or dark.\n mode,\n // The colors used to represent primary interface elements for a user.\n primary: augmentColor({\n color: primary,\n name: 'primary'\n }),\n // The colors used to represent secondary interface elements for a user.\n secondary: augmentColor({\n color: secondary,\n name: 'secondary',\n mainShade: 'A400',\n lightShade: 'A200',\n darkShade: 'A700'\n }),\n // The colors used to represent interface elements that the user should be made aware of.\n error: augmentColor({\n color: error,\n name: 'error'\n }),\n // The colors used to represent potentially dangerous actions or important messages.\n warning: augmentColor({\n color: warning,\n name: 'warning'\n }),\n // The colors used to present information to the user that is neutral and not necessarily important.\n info: augmentColor({\n color: info,\n name: 'info'\n }),\n // The colors used to indicate the successful completion of an action that user triggered.\n success: augmentColor({\n color: success,\n name: 'success'\n }),\n // The grey colors.\n grey,\n // Used by `getContrastText()` to maximize the contrast between\n // the background and the text.\n contrastThreshold,\n // Takes a background color and returns the text color that maximizes the contrast.\n getContrastText,\n // Generate a rich color object.\n augmentColor,\n // Used by the functions below to shift a color's luminance by approximately\n // two indexes within its tonal palette.\n // E.g., shift from Red 500 to Red 300 or Red 700.\n tonalOffset\n }, modes[mode]), other);\n return paletteOutput;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"fontFamily\", \"fontSize\", \"fontWeightLight\", \"fontWeightRegular\", \"fontWeightMedium\", \"fontWeightBold\", \"htmlFontSize\", \"allVariants\", \"pxToRem\"];\nimport { deepmerge } from '@mui/utils';\nfunction round(value) {\n return Math.round(value * 1e5) / 1e5;\n}\nconst caseAllCaps = {\n textTransform: 'uppercase'\n};\nconst defaultFontFamily = '\"Roboto\", \"Helvetica\", \"Arial\", sans-serif';\n\n/**\n * @see @link{https://m2.material.io/design/typography/the-type-system.html}\n * @see @link{https://m2.material.io/design/typography/understanding-typography.html}\n */\nexport default function createTypography(palette, typography) {\n const _ref = typeof typography === 'function' ? typography(palette) : typography,\n {\n fontFamily = defaultFontFamily,\n // The default font size of the Material Specification.\n fontSize = 14,\n // px\n fontWeightLight = 300,\n fontWeightRegular = 400,\n fontWeightMedium = 500,\n fontWeightBold = 700,\n // Tell MUI what's the font-size on the html element.\n // 16px is the default font-size used by browsers.\n htmlFontSize = 16,\n // Apply the CSS properties to all the variants.\n allVariants,\n pxToRem: pxToRem2\n } = _ref,\n other = _objectWithoutPropertiesLoose(_ref, _excluded);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof fontSize !== 'number') {\n console.error('MUI: `fontSize` is required to be a number.');\n }\n if (typeof htmlFontSize !== 'number') {\n console.error('MUI: `htmlFontSize` is required to be a number.');\n }\n }\n const coef = fontSize / 14;\n const pxToRem = pxToRem2 || (size => `${size / htmlFontSize * coef}rem`);\n const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends({\n fontFamily,\n fontWeight,\n fontSize: pxToRem(size),\n // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/\n lineHeight\n }, fontFamily === defaultFontFamily ? {\n letterSpacing: `${round(letterSpacing / size)}em`\n } : {}, casing, allVariants);\n const variants = {\n h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),\n h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),\n h3: buildVariant(fontWeightRegular, 48, 1.167, 0),\n h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),\n h5: buildVariant(fontWeightRegular, 24, 1.334, 0),\n h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),\n subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),\n subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),\n body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),\n body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),\n button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),\n caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),\n overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps)\n };\n return deepmerge(_extends({\n htmlFontSize,\n pxToRem,\n fontFamily,\n fontSize,\n fontWeightLight,\n fontWeightRegular,\n fontWeightMedium,\n fontWeightBold\n }, variants), other, {\n clone: false // No need to clone deep\n });\n}","const shadowKeyUmbraOpacity = 0.2;\nconst shadowKeyPenumbraOpacity = 0.14;\nconst shadowAmbientShadowOpacity = 0.12;\nfunction createShadow(...px) {\n return [`${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(',');\n}\n\n// Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss\nconst shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];\nexport default shadows;","// We need to centralize the zIndex definitions as they work\n// like global values in the browser.\nconst zIndex = {\n mobileStepper: 1000,\n fab: 1050,\n speedDial: 1050,\n appBar: 1100,\n drawer: 1200,\n modal: 1300,\n snackbar: 1400,\n tooltip: 1500\n};\nexport default zIndex;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport { formatMuiErrorMessage as _formatMuiErrorMessage } from \"@mui/utils\";\nconst _excluded = [\"breakpoints\", \"mixins\", \"spacing\", \"palette\", \"transitions\", \"typography\", \"shape\"];\nimport { deepmerge } from '@mui/utils';\nimport { createTheme as systemCreateTheme, unstable_defaultSxConfig as defaultSxConfig, unstable_styleFunctionSx as styleFunctionSx } from '@mui/system';\nimport generateUtilityClass from '../generateUtilityClass';\nimport createMixins from './createMixins';\nimport createPalette from './createPalette';\nimport createTypography from './createTypography';\nimport shadows from './shadows';\nimport createTransitions from './createTransitions';\nimport zIndex from './zIndex';\nfunction createTheme(options = {}, ...args) {\n const {\n mixins: mixinsInput = {},\n palette: paletteInput = {},\n transitions: transitionsInput = {},\n typography: typographyInput = {}\n } = options,\n other = _objectWithoutPropertiesLoose(options, _excluded);\n if (options.vars) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: \\`vars\\` is a private field used for CSS variables support.\nPlease use another name.` : _formatMuiErrorMessage(18));\n }\n const palette = createPalette(paletteInput);\n const systemTheme = systemCreateTheme(options);\n let muiTheme = deepmerge(systemTheme, {\n mixins: createMixins(systemTheme.breakpoints, mixinsInput),\n palette,\n // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.\n shadows: shadows.slice(),\n typography: createTypography(palette, typographyInput),\n transitions: createTransitions(transitionsInput),\n zIndex: _extends({}, zIndex)\n });\n muiTheme = deepmerge(muiTheme, other);\n muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);\n if (process.env.NODE_ENV !== 'production') {\n const stateClasses = ['active', 'checked', 'completed', 'disabled', 'error', 'expanded', 'focused', 'focusVisible', 'required', 'selected'];\n const traverse = (node, component) => {\n let key;\n\n // eslint-disable-next-line guard-for-in, no-restricted-syntax\n for (key in node) {\n const child = node[key];\n if (stateClasses.indexOf(key) !== -1 && Object.keys(child).length > 0) {\n if (process.env.NODE_ENV !== 'production') {\n const stateClass = generateUtilityClass('', key);\n console.error([`MUI: The \\`${component}\\` component increases ` + `the CSS specificity of the \\`${key}\\` internal state.`, 'You can not override it like this: ', JSON.stringify(node, null, 2), '', `Instead, you need to use the '&.${stateClass}' syntax:`, JSON.stringify({\n root: {\n [`&.${stateClass}`]: child\n }\n }, null, 2), '', 'https://mui.com/r/state-classes-guide'].join('\\n'));\n }\n // Remove the style to prevent global conflicts.\n node[key] = {};\n }\n }\n };\n Object.keys(muiTheme.components).forEach(component => {\n const styleOverrides = muiTheme.components[component].styleOverrides;\n if (styleOverrides && component.indexOf('Mui') === 0) {\n traverse(styleOverrides, component);\n }\n });\n }\n muiTheme.unstable_sxConfig = _extends({}, defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);\n muiTheme.unstable_sx = function sx(props) {\n return styleFunctionSx({\n sx: props,\n theme: this\n });\n };\n return muiTheme;\n}\nlet warnedOnce = false;\nexport function createMuiTheme(...args) {\n if (process.env.NODE_ENV !== 'production') {\n if (!warnedOnce) {\n warnedOnce = true;\n console.error(['MUI: the createMuiTheme function was renamed to createTheme.', '', \"You should use `import { createTheme } from '@mui/material/styles'`\"].join('\\n'));\n }\n }\n return createTheme(...args);\n}\nexport default createTheme;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"duration\", \"easing\", \"delay\"];\n// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves\n// to learn the context in which each easing should be used.\nexport const easing = {\n // This is the most common easing curve.\n easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',\n // Objects enter the screen at full velocity from off-screen and\n // slowly decelerate to a resting point.\n easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',\n // Objects leave the screen at full velocity. They do not decelerate when off-screen.\n easeIn: 'cubic-bezier(0.4, 0, 1, 1)',\n // The sharp curve is used by objects that may return to the screen at any time.\n sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'\n};\n\n// Follow https://m2.material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations\n// to learn when use what timing\nexport const duration = {\n shortest: 150,\n shorter: 200,\n short: 250,\n // most basic recommended timing\n standard: 300,\n // this is to be used in complex animations\n complex: 375,\n // recommended when something is entering screen\n enteringScreen: 225,\n // recommended when something is leaving screen\n leavingScreen: 195\n};\nfunction formatMs(milliseconds) {\n return `${Math.round(milliseconds)}ms`;\n}\nfunction getAutoHeightDuration(height) {\n if (!height) {\n return 0;\n }\n const constant = height / 36;\n\n // https://www.wolframalpha.com/input/?i=(4+%2B+15+*+(x+%2F+36+)+**+0.25+%2B+(x+%2F+36)+%2F+5)+*+10\n return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);\n}\nexport default function createTransitions(inputTransitions) {\n const mergedEasing = _extends({}, easing, inputTransitions.easing);\n const mergedDuration = _extends({}, duration, inputTransitions.duration);\n const create = (props = ['all'], options = {}) => {\n const {\n duration: durationOption = mergedDuration.standard,\n easing: easingOption = mergedEasing.easeInOut,\n delay = 0\n } = options,\n other = _objectWithoutPropertiesLoose(options, _excluded);\n if (process.env.NODE_ENV !== 'production') {\n const isString = value => typeof value === 'string';\n // IE11 support, replace with Number.isNaN\n // eslint-disable-next-line no-restricted-globals\n const isNumber = value => !isNaN(parseFloat(value));\n if (!isString(props) && !Array.isArray(props)) {\n console.error('MUI: Argument \"props\" must be a string or Array.');\n }\n if (!isNumber(durationOption) && !isString(durationOption)) {\n console.error(`MUI: Argument \"duration\" must be a number or a string but found ${durationOption}.`);\n }\n if (!isString(easingOption)) {\n console.error('MUI: Argument \"easing\" must be a string.');\n }\n if (!isNumber(delay) && !isString(delay)) {\n console.error('MUI: Argument \"delay\" must be a number or a string.');\n }\n if (Object.keys(other).length !== 0) {\n console.error(`MUI: Unrecognized argument(s) [${Object.keys(other).join(',')}].`);\n }\n }\n return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');\n };\n return _extends({\n getAutoHeightDuration,\n create\n }, inputTransitions, {\n easing: mergedEasing,\n duration: mergedDuration\n });\n}","import createTheme from './createTheme';\nconst defaultTheme = createTheme();\nexport default defaultTheme;","import { createStyled, shouldForwardProp } from '@mui/system';\nimport defaultTheme from './defaultTheme';\nexport const rootShouldForwardProp = prop => shouldForwardProp(prop) && prop !== 'classes';\nexport const slotShouldForwardProp = shouldForwardProp;\nconst styled = createStyled({\n defaultTheme,\n rootShouldForwardProp\n});\nexport default styled;","import getThemeProps from './getThemeProps';\nimport useTheme from '../useTheme';\nexport default function useThemeProps({\n props,\n name,\n defaultTheme\n}) {\n const theme = useTheme(defaultTheme);\n const mergedProps = getThemeProps({\n theme,\n name,\n props\n });\n return mergedProps;\n}","import { internal_resolveProps as resolveProps } from '@mui/utils';\nexport default function getThemeProps(params) {\n const {\n theme,\n name,\n props\n } = params;\n if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {\n return props;\n }\n return resolveProps(theme.components[name].defaultProps, props);\n}","import { useThemeProps as systemUseThemeProps } from '@mui/system';\nimport defaultTheme from './defaultTheme';\nexport default function useThemeProps({\n props,\n name\n}) {\n return systemUseThemeProps({\n props,\n name,\n defaultTheme\n });\n}","import { unstable_capitalize as capitalize } from '@mui/utils';\nexport default capitalize;","import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nimport generateUtilityClass from '../generateUtilityClass';\nexport function getSvgIconUtilityClass(slot) {\n return generateUtilityClass('MuiSvgIcon', slot);\n}\nconst svgIconClasses = generateUtilityClasses('MuiSvgIcon', ['root', 'colorPrimary', 'colorSecondary', 'colorAction', 'colorError', 'colorDisabled', 'fontSizeInherit', 'fontSizeSmall', 'fontSizeMedium', 'fontSizeLarge']);\nexport default svgIconClasses;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"className\", \"color\", \"component\", \"fontSize\", \"htmlColor\", \"inheritViewBox\", \"titleAccess\", \"viewBox\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport capitalize from '../utils/capitalize';\nimport useThemeProps from '../styles/useThemeProps';\nimport styled from '../styles/styled';\nimport { getSvgIconUtilityClass } from './svgIconClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n color,\n fontSize,\n classes\n } = ownerState;\n const slots = {\n root: ['root', color !== 'inherit' && `color${capitalize(color)}`, `fontSize${capitalize(fontSize)}`]\n };\n return composeClasses(slots, getSvgIconUtilityClass, classes);\n};\nconst SvgIconRoot = styled('svg', {\n name: 'MuiSvgIcon',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.color !== 'inherit' && styles[`color${capitalize(ownerState.color)}`], styles[`fontSize${capitalize(ownerState.fontSize)}`]];\n }\n})(({\n theme,\n ownerState\n}) => {\n var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$transitions2$d, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _palette$ownerState$c, _palette, _palette$ownerState$c2, _palette2, _palette2$action, _palette3, _palette3$action;\n return {\n userSelect: 'none',\n width: '1em',\n height: '1em',\n display: 'inline-block',\n fill: 'currentColor',\n flexShrink: 0,\n transition: (_theme$transitions = theme.transitions) == null ? void 0 : (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {\n duration: (_theme$transitions2 = theme.transitions) == null ? void 0 : (_theme$transitions2$d = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2$d.shorter\n }),\n fontSize: {\n inherit: 'inherit',\n small: ((_theme$typography = theme.typography) == null ? void 0 : (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem',\n medium: ((_theme$typography2 = theme.typography) == null ? void 0 : (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem',\n large: ((_theme$typography3 = theme.typography) == null ? void 0 : (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875rem'\n }[ownerState.fontSize],\n // TODO v5 deprecate, v6 remove for sx\n color: (_palette$ownerState$c = (_palette = (theme.vars || theme).palette) == null ? void 0 : (_palette$ownerState$c2 = _palette[ownerState.color]) == null ? void 0 : _palette$ownerState$c2.main) != null ? _palette$ownerState$c : {\n action: (_palette2 = (theme.vars || theme).palette) == null ? void 0 : (_palette2$action = _palette2.action) == null ? void 0 : _palette2$action.active,\n disabled: (_palette3 = (theme.vars || theme).palette) == null ? void 0 : (_palette3$action = _palette3.action) == null ? void 0 : _palette3$action.disabled,\n inherit: undefined\n }[ownerState.color]\n };\n});\nconst SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiSvgIcon'\n });\n const {\n children,\n className,\n color = 'inherit',\n component = 'svg',\n fontSize = 'medium',\n htmlColor,\n inheritViewBox = false,\n titleAccess,\n viewBox = '0 0 24 24'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n color,\n component,\n fontSize,\n instanceFontSize: inProps.fontSize,\n inheritViewBox,\n viewBox\n });\n const more = {};\n if (!inheritViewBox) {\n more.viewBox = viewBox;\n }\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsxs(SvgIconRoot, _extends({\n as: component,\n className: clsx(classes.root, className),\n focusable: \"false\",\n color: htmlColor,\n \"aria-hidden\": titleAccess ? undefined : true,\n role: titleAccess ? 'img' : undefined,\n ref: ref\n }, more, other, {\n ownerState: ownerState,\n children: [children, titleAccess ? /*#__PURE__*/_jsx(\"title\", {\n children: titleAccess\n }) : null]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? SvgIcon.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Node passed into the SVG element.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).\n * You can use the `htmlColor` prop to apply a color attribute to the SVG element.\n * @default 'inherit'\n */\n color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['inherit', 'action', 'disabled', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.\n * @default 'medium'\n */\n fontSize: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['inherit', 'large', 'medium', 'small']), PropTypes.string]),\n /**\n * Applies a color attribute to the SVG element.\n */\n htmlColor: PropTypes.string,\n /**\n * If `true`, the root node will inherit the custom `component`'s viewBox and the `viewBox`\n * prop will be ignored.\n * Useful when you want to reference a custom `component` and have `SvgIcon` pass that\n * `component`'s viewBox to the root node.\n * @default false\n */\n inheritViewBox: PropTypes.bool,\n /**\n * The shape-rendering attribute. The behavior of the different options is described on the\n * [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering).\n * If you are having issues with blurry icons you should investigate this prop.\n */\n shapeRendering: PropTypes.string,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * Provides a human-readable title for the element that contains it.\n * https://www.w3.org/TR/SVG-access/#Equivalent\n */\n titleAccess: PropTypes.string,\n /**\n * Allows you to redefine what the coordinates without units mean inside an SVG element.\n * For example, if the SVG element is 500 (width) by 200 (height),\n * and you pass viewBox=\"0 0 50 20\",\n * this means that the coordinates inside the SVG will go from the top left corner (0,0)\n * to bottom right (50,20) and each unit will be worth 10px.\n * @default '0 0 24 24'\n */\n viewBox: PropTypes.string\n} : void 0;\nSvgIcon.muiName = 'SvgIcon';\nexport default SvgIcon;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport SvgIcon from '../SvgIcon';\n\n/**\n * Private module reserved for @mui packages.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function createSvgIcon(path, displayName) {\n function Component(props, ref) {\n return /*#__PURE__*/_jsx(SvgIcon, _extends({\n \"data-testid\": `${displayName}Icon`,\n ref: ref\n }, props, {\n children: path\n }));\n }\n if (process.env.NODE_ENV !== 'production') {\n // Need to set `displayName` on the inner component for React.memo.\n // React prior to 16.14 ignores `displayName` on the wrapper.\n Component.displayName = `${displayName}Icon`;\n }\n Component.muiName = SvgIcon.muiName;\n return /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Component));\n}","import { unstable_debounce as debounce } from '@mui/utils';\nexport default debounce;","import { unstable_createChainedFunction as createChainedFunction } from '@mui/utils';\nexport default createChainedFunction;","import { unstable_deprecatedPropType as deprecatedPropType } from '@mui/utils';\nexport default deprecatedPropType;","export default function deprecatedPropType(validator, reason) {\n if (process.env.NODE_ENV === 'production') {\n return () => null;\n }\n return (props, propName, componentName, location, propFullName) => {\n const componentNameSafe = componentName || '<>';\n const propFullNameSafe = propFullName || propName;\n if (typeof props[propName] !== 'undefined') {\n return new Error(`The ${location} \\`${propFullNameSafe}\\` of ` + `\\`${componentNameSafe}\\` is deprecated. ${reason}`);\n }\n return null;\n };\n}","import { unstable_requirePropFactory as requirePropFactory } from '@mui/utils';\nexport default requirePropFactory;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nexport default function requirePropFactory(componentNameInError, Component) {\n if (process.env.NODE_ENV === 'production') {\n return () => null;\n }\n\n // eslint-disable-next-line react/forbid-foreign-prop-types\n const prevPropTypes = Component ? _extends({}, Component.propTypes) : null;\n const requireProp = requiredProp => (props, propName, componentName, location, propFullName, ...args) => {\n const propFullNameSafe = propFullName || propName;\n const defaultTypeChecker = prevPropTypes == null ? void 0 : prevPropTypes[propFullNameSafe];\n if (defaultTypeChecker) {\n const typeCheckerResult = defaultTypeChecker(props, propName, componentName, location, propFullName, ...args);\n if (typeCheckerResult) {\n return typeCheckerResult;\n }\n }\n if (typeof props[propName] !== 'undefined' && !props[requiredProp]) {\n return new Error(`The prop \\`${propFullNameSafe}\\` of ` + `\\`${componentNameInError}\\` can only be used together with the \\`${requiredProp}\\` prop.`);\n }\n return null;\n };\n return requireProp;\n}","import { unstable_setRef as setRef } from '@mui/utils';\nexport default setRef;","import { unstable_unsupportedProp as unsupportedProp } from '@mui/utils';\nexport default unsupportedProp;","export default function unsupportedProp(props, propName, componentName, location, propFullName) {\n if (process.env.NODE_ENV === 'production') {\n return null;\n }\n const propFullNameSafe = propFullName || propName;\n if (typeof props[propName] !== 'undefined') {\n return new Error(`The prop \\`${propFullNameSafe}\\` is not supported. Please remove it.`);\n }\n return null;\n}","import { unstable_ClassNameGenerator as ClassNameGenerator } from '@mui/base/className';\nexport { default as capitalize } from './capitalize';\nexport { default as createChainedFunction } from './createChainedFunction';\nexport { default as createSvgIcon } from './createSvgIcon';\nexport { default as debounce } from './debounce';\nexport { default as deprecatedPropType } from './deprecatedPropType';\nexport { default as isMuiElement } from './isMuiElement';\nexport { default as ownerDocument } from './ownerDocument';\nexport { default as ownerWindow } from './ownerWindow';\nexport { default as requirePropFactory } from './requirePropFactory';\nexport { default as setRef } from './setRef';\nexport { default as unstable_useEnhancedEffect } from './useEnhancedEffect';\nexport { default as unstable_useId } from './useId';\nexport { default as unsupportedProp } from './unsupportedProp';\nexport { default as useControlled } from './useControlled';\nexport { default as useEventCallback } from './useEventCallback';\nexport { default as useForkRef } from './useForkRef';\nexport { default as useIsFocusVisible } from './useIsFocusVisible';\n// TODO: remove this export once ClassNameGenerator is stable\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const unstable_ClassNameGenerator = {\n configure: generator => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(['MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.', '', \"You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead\", '', 'The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401', '', 'The updated documentation: https://mui.com/guides/classname-generator/'].join('\\n'));\n }\n ClassNameGenerator.configure(generator);\n }\n};","import { unstable_isMuiElement as isMuiElement } from '@mui/utils';\nexport default isMuiElement;","import * as React from 'react';\nexport default function isMuiElement(element, muiNames) {\n return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf(element.type.muiName) !== -1;\n}","import { unstable_ownerDocument as ownerDocument } from '@mui/utils';\nexport default ownerDocument;","import { unstable_ownerWindow as ownerWindow } from '@mui/utils';\nexport default ownerWindow;","import { unstable_useControlled as useControlled } from '@mui/utils';\nexport default useControlled;","import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';\nexport default useEnhancedEffect;","import { unstable_useEventCallback as useEventCallback } from '@mui/utils';\nexport default useEventCallback;","import { unstable_useForkRef as useForkRef } from '@mui/utils';\nexport default useForkRef;","import { unstable_useId as useId } from '@mui/utils';\nexport default useId;","// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js\nimport * as React from 'react';\nlet hadKeyboardEvent = true;\nlet hadFocusVisibleRecently = false;\nlet hadFocusVisibleRecentlyTimeout;\nconst inputTypesWhitelist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n};\n\n/**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} node\n * @returns {boolean}\n */\nfunction focusTriggersKeyboardModality(node) {\n const {\n type,\n tagName\n } = node;\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {\n return true;\n }\n if (tagName === 'TEXTAREA' && !node.readOnly) {\n return true;\n }\n if (node.isContentEditable) {\n return true;\n }\n return false;\n}\n\n/**\n * Keep track of our keyboard modality state with `hadKeyboardEvent`.\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * @param {KeyboardEvent} event\n */\nfunction handleKeyDown(event) {\n if (event.metaKey || event.altKey || event.ctrlKey) {\n return;\n }\n hadKeyboardEvent = true;\n}\n\n/**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n */\nfunction handlePointerDown() {\n hadKeyboardEvent = false;\n}\nfunction handleVisibilityChange() {\n if (this.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n }\n}\nfunction prepare(doc) {\n doc.addEventListener('keydown', handleKeyDown, true);\n doc.addEventListener('mousedown', handlePointerDown, true);\n doc.addEventListener('pointerdown', handlePointerDown, true);\n doc.addEventListener('touchstart', handlePointerDown, true);\n doc.addEventListener('visibilitychange', handleVisibilityChange, true);\n}\nexport function teardown(doc) {\n doc.removeEventListener('keydown', handleKeyDown, true);\n doc.removeEventListener('mousedown', handlePointerDown, true);\n doc.removeEventListener('pointerdown', handlePointerDown, true);\n doc.removeEventListener('touchstart', handlePointerDown, true);\n doc.removeEventListener('visibilitychange', handleVisibilityChange, true);\n}\nfunction isFocusVisible(event) {\n const {\n target\n } = event;\n try {\n return target.matches(':focus-visible');\n } catch (error) {\n // Browsers not implementing :focus-visible will throw a SyntaxError.\n // We use our own heuristic for those browsers.\n // Rethrow might be better if it's not the expected error but do we really\n // want to crash if focus-visible malfunctioned?\n }\n\n // No need for validFocusTarget check. The user does that by attaching it to\n // focusable events only.\n return hadKeyboardEvent || focusTriggersKeyboardModality(target);\n}\nexport default function useIsFocusVisible() {\n const ref = React.useCallback(node => {\n if (node != null) {\n prepare(node.ownerDocument);\n }\n }, []);\n const isFocusVisibleRef = React.useRef(false);\n\n /**\n * Should be called if a blur event is fired\n */\n function handleBlurVisible() {\n // checking against potential state variable does not suffice if we focus and blur synchronously.\n // React wouldn't have time to trigger a re-render so `focusVisible` would be stale.\n // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.\n // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751\n // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).\n if (isFocusVisibleRef.current) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(() => {\n hadFocusVisibleRecently = false;\n }, 100);\n isFocusVisibleRef.current = false;\n return true;\n }\n return false;\n }\n\n /**\n * Should be called if a blur event is fired\n */\n function handleFocusVisible(event) {\n if (isFocusVisible(event)) {\n isFocusVisibleRef.current = true;\n return true;\n }\n return false;\n }\n return {\n isFocusVisibleRef,\n onFocus: handleFocusVisible,\n onBlur: handleBlurVisible,\n ref\n };\n}","import { unstable_useIsFocusVisible as useIsFocusVisible } from '@mui/utils';\nexport default useIsFocusVisible;","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar isPropValid = /* #__PURE__ */memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default isPropValid;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport { useContext, createElement, Fragment } from 'react';\nimport isPropValid from '@emotion/is-prop-valid';\nimport { withEmotionCache, ThemeContext } from '@emotion/react';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\nvar testOmitPropsOnStringTag = isPropValid;\n\nvar testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {\n return key !== 'theme';\n};\n\nvar getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {\n return typeof tag === 'string' && // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;\n};\nvar composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {\n var shouldForwardProp;\n\n if (options) {\n var optionsShouldForwardProp = options.shouldForwardProp;\n shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {\n return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);\n } : optionsShouldForwardProp;\n }\n\n if (typeof shouldForwardProp !== 'function' && isReal) {\n shouldForwardProp = tag.__emotion_forwardProp;\n }\n\n return shouldForwardProp;\n};\n\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n var rules = useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar createStyled = function createStyled(tag, options) {\n if (process.env.NODE_ENV !== 'production') {\n if (tag === undefined) {\n throw new Error('You are trying to create a styled element with an undefined component.\\nYou may have forgotten to import it.');\n }\n }\n\n var isReal = tag.__emotion_real === tag;\n var baseTag = isReal && tag.__emotion_base || tag;\n var identifierName;\n var targetClassName;\n\n if (options !== undefined) {\n identifierName = options.label;\n targetClassName = options.target;\n }\n\n var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);\n var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);\n var shouldUseAs = !defaultShouldForwardProp('as');\n return function () {\n var args = arguments;\n var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];\n\n if (identifierName !== undefined) {\n styles.push(\"label:\" + identifierName + \";\");\n }\n\n if (args[0] == null || args[0].raw === undefined) {\n styles.push.apply(styles, args);\n } else {\n if (process.env.NODE_ENV !== 'production' && args[0][0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles.push(args[0][0]);\n var len = args.length;\n var i = 1;\n\n for (; i < len; i++) {\n if (process.env.NODE_ENV !== 'production' && args[0][i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles.push(args[i], args[0][i]);\n }\n } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class\n\n\n var Styled = withEmotionCache(function (props, cache, ref) {\n var FinalTag = shouldUseAs && props.as || baseTag;\n var className = '';\n var classInterpolations = [];\n var mergedProps = props;\n\n if (props.theme == null) {\n mergedProps = {};\n\n for (var key in props) {\n mergedProps[key] = props[key];\n }\n\n mergedProps.theme = useContext(ThemeContext);\n }\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, classInterpolations, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);\n className += cache.key + \"-\" + serialized.name;\n\n if (targetClassName !== undefined) {\n className += \" \" + targetClassName;\n }\n\n var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;\n var newProps = {};\n\n for (var _key in props) {\n if (shouldUseAs && _key === 'as') continue;\n\n if ( // $FlowFixMe\n finalShouldForwardProp(_key)) {\n newProps[_key] = props[_key];\n }\n }\n\n newProps.className = className;\n newProps.ref = ref;\n return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof FinalTag === 'string'\n }), /*#__PURE__*/createElement(FinalTag, newProps));\n });\n Styled.displayName = identifierName !== undefined ? identifierName : \"Styled(\" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + \")\";\n Styled.defaultProps = tag.defaultProps;\n Styled.__emotion_real = Styled;\n Styled.__emotion_base = baseTag;\n Styled.__emotion_styles = styles;\n Styled.__emotion_forwardProp = shouldForwardProp;\n Object.defineProperty(Styled, 'toString', {\n value: function value() {\n if (targetClassName === undefined && process.env.NODE_ENV !== 'production') {\n return 'NO_COMPONENT_SELECTOR';\n } // $FlowFixMe: coerce undefined to string\n\n\n return \".\" + targetClassName;\n }\n });\n\n Styled.withComponent = function (nextTag, nextOptions) {\n return createStyled(nextTag, _extends({}, options, nextOptions, {\n shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)\n })).apply(void 0, styles);\n };\n\n return Styled;\n };\n};\n\nexport default createStyled;\n","import '@babel/runtime/helpers/extends';\nimport 'react';\nimport '@emotion/is-prop-valid';\nimport createStyled from '../base/dist/emotion-styled-base.browser.esm.js';\nimport '@emotion/react';\nimport '@emotion/utils';\nimport '@emotion/serialize';\nimport '@emotion/use-insertion-effect-with-fallbacks';\n\nvar tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG\n'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];\n\nvar newStyled = createStyled.bind();\ntags.forEach(function (tagName) {\n // $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type\n newStyled[tagName] = newStyled(tagName);\n});\n\nexport default newStyled;\n","/** @license MUI v5.11.0\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/* eslint-disable no-underscore-dangle */\nimport emStyled from '@emotion/styled';\nexport default function styled(tag, options) {\n const stylesFactory = emStyled(tag, options);\n if (process.env.NODE_ENV !== 'production') {\n return (...styles) => {\n const component = typeof tag === 'string' ? `\"${tag}\"` : 'component';\n if (styles.length === 0) {\n console.error([`MUI: Seems like you called \\`styled(${component})()\\` without a \\`style\\` argument.`, 'You must provide a `styles` argument: `styled(\"div\")(styleYouForgotToPass)`.'].join('\\n'));\n } else if (styles.some(style => style === undefined)) {\n console.error(`MUI: the styled(${component})(...args) API requires all its args to be defined.`);\n }\n return stylesFactory(...styles);\n };\n }\n return stylesFactory;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const internal_processStyles = (tag, processor) => {\n // Emotion attaches all the styles as `__emotion_styles`.\n // Ref: https://github.com/emotion-js/emotion/blob/16d971d0da229596d6bcc39d282ba9753c9ee7cf/packages/styled/src/base.js#L186\n if (Array.isArray(tag.__emotion_styles)) {\n tag.__emotion_styles = processor(tag.__emotion_styles);\n }\n};\nexport { ThemeContext, keyframes, css } from '@emotion/react';\nexport { default as StyledEngineProvider } from './StyledEngineProvider';\nexport { default as GlobalStyles } from './GlobalStyles';","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport PropTypes from 'prop-types';\nimport { deepmerge } from '@mui/utils';\nimport merge from './merge';\n\n// The breakpoint **start** at this value.\n// For instance with the first breakpoint xs: [xs, sm[.\nexport const values = {\n xs: 0,\n // phone\n sm: 600,\n // tablet\n md: 900,\n // small laptop\n lg: 1200,\n // desktop\n xl: 1536 // large screen\n};\n\nconst defaultBreakpoints = {\n // Sorted ASC by size. That's important.\n // It can't be configured as it's used statically for propTypes.\n keys: ['xs', 'sm', 'md', 'lg', 'xl'],\n up: key => `@media (min-width:${values[key]}px)`\n};\nexport function handleBreakpoints(props, propValue, styleFromPropValue) {\n const theme = props.theme || {};\n if (Array.isArray(propValue)) {\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n return propValue.reduce((acc, item, index) => {\n acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);\n return acc;\n }, {});\n }\n if (typeof propValue === 'object') {\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n return Object.keys(propValue).reduce((acc, breakpoint) => {\n // key is breakpoint\n if (Object.keys(themeBreakpoints.values || values).indexOf(breakpoint) !== -1) {\n const mediaKey = themeBreakpoints.up(breakpoint);\n acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);\n } else {\n const cssKey = breakpoint;\n acc[cssKey] = propValue[cssKey];\n }\n return acc;\n }, {});\n }\n const output = styleFromPropValue(propValue);\n return output;\n}\nfunction breakpoints(styleFunction) {\n // false positive\n // eslint-disable-next-line react/function-component-definition\n const newStyleFunction = props => {\n const theme = props.theme || {};\n const base = styleFunction(props);\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n const extended = themeBreakpoints.keys.reduce((acc, key) => {\n if (props[key]) {\n acc = acc || {};\n acc[themeBreakpoints.up(key)] = styleFunction(_extends({\n theme\n }, props[key]));\n }\n return acc;\n }, null);\n return merge(base, extended);\n };\n newStyleFunction.propTypes = process.env.NODE_ENV !== 'production' ? _extends({}, styleFunction.propTypes, {\n xs: PropTypes.object,\n sm: PropTypes.object,\n md: PropTypes.object,\n lg: PropTypes.object,\n xl: PropTypes.object\n }) : {};\n newStyleFunction.filterProps = ['xs', 'sm', 'md', 'lg', 'xl', ...styleFunction.filterProps];\n return newStyleFunction;\n}\nexport function createEmptyBreakpointObject(breakpointsInput = {}) {\n var _breakpointsInput$key;\n const breakpointsInOrder = (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {\n const breakpointStyleKey = breakpointsInput.up(key);\n acc[breakpointStyleKey] = {};\n return acc;\n }, {});\n return breakpointsInOrder || {};\n}\nexport function removeUnusedBreakpoints(breakpointKeys, style) {\n return breakpointKeys.reduce((acc, key) => {\n const breakpointOutput = acc[key];\n const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;\n if (isBreakpointUnused) {\n delete acc[key];\n }\n return acc;\n }, style);\n}\nexport function mergeBreakpointsInOrder(breakpointsInput, ...styles) {\n const emptyBreakpoints = createEmptyBreakpointObject(breakpointsInput);\n const mergedOutput = [emptyBreakpoints, ...styles].reduce((prev, next) => deepmerge(prev, next), {});\n return removeUnusedBreakpoints(Object.keys(emptyBreakpoints), mergedOutput);\n}\n\n// compute base for responsive values; e.g.,\n// [1,2,3] => {xs: true, sm: true, md: true}\n// {xs: 1, sm: 2, md: 3} => {xs: true, sm: true, md: true}\nexport function computeBreakpointsBase(breakpointValues, themeBreakpoints) {\n // fixed value\n if (typeof breakpointValues !== 'object') {\n return {};\n }\n const base = {};\n const breakpointsKeys = Object.keys(themeBreakpoints);\n if (Array.isArray(breakpointValues)) {\n breakpointsKeys.forEach((breakpoint, i) => {\n if (i < breakpointValues.length) {\n base[breakpoint] = true;\n }\n });\n } else {\n breakpointsKeys.forEach(breakpoint => {\n if (breakpointValues[breakpoint] != null) {\n base[breakpoint] = true;\n }\n });\n }\n return base;\n}\nexport function resolveBreakpointValues({\n values: breakpointValues,\n breakpoints: themeBreakpoints,\n base: customBase\n}) {\n const base = customBase || computeBreakpointsBase(breakpointValues, themeBreakpoints);\n const keys = Object.keys(base);\n if (keys.length === 0) {\n return breakpointValues;\n }\n let previous;\n return keys.reduce((acc, breakpoint, i) => {\n if (Array.isArray(breakpointValues)) {\n acc[breakpoint] = breakpointValues[i] != null ? breakpointValues[i] : breakpointValues[previous];\n previous = i;\n } else if (typeof breakpointValues === 'object') {\n acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous];\n previous = breakpoint;\n } else {\n acc[breakpoint] = breakpointValues;\n }\n return acc;\n }, {});\n}\nexport default breakpoints;","import { formatMuiErrorMessage as _formatMuiErrorMessage } from \"@mui/utils\";\n/**\n * Returns a number whose value is limited to the given range.\n * @param {number} value The value to be clamped\n * @param {number} min The lower boundary of the output range\n * @param {number} max The upper boundary of the output range\n * @returns {number} A number in the range [min, max]\n */\nfunction clamp(value, min = 0, max = 1) {\n if (process.env.NODE_ENV !== 'production') {\n if (value < min || value > max) {\n console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);\n }\n }\n return Math.min(Math.max(min, value), max);\n}\n\n/**\n * Converts a color from CSS hex format to CSS rgb format.\n * @param {string} color - Hex color, i.e. #nnn or #nnnnnn\n * @returns {string} A CSS rgb color string\n */\nexport function hexToRgb(color) {\n color = color.slice(1);\n const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, 'g');\n let colors = color.match(re);\n if (colors && colors[0].length === 1) {\n colors = colors.map(n => n + n);\n }\n return colors ? `rgb${colors.length === 4 ? 'a' : ''}(${colors.map((n, index) => {\n return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;\n }).join(', ')})` : '';\n}\nfunction intToHex(int) {\n const hex = int.toString(16);\n return hex.length === 1 ? `0${hex}` : hex;\n}\n\n/**\n * Returns an object with the type and values of a color.\n *\n * Note: Does not support rgb % values.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {object} - A MUI color object: {type: string, values: number[]}\n */\nexport function decomposeColor(color) {\n // Idempotent\n if (color.type) {\n return color;\n }\n if (color.charAt(0) === '#') {\n return decomposeColor(hexToRgb(color));\n }\n const marker = color.indexOf('(');\n const type = color.substring(0, marker);\n if (['rgb', 'rgba', 'hsl', 'hsla', 'color'].indexOf(type) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: Unsupported \\`${color}\\` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : _formatMuiErrorMessage(9, color));\n }\n let values = color.substring(marker + 1, color.length - 1);\n let colorSpace;\n if (type === 'color') {\n values = values.split(' ');\n colorSpace = values.shift();\n if (values.length === 4 && values[3].charAt(0) === '/') {\n values[3] = values[3].slice(1);\n }\n if (['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].indexOf(colorSpace) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: unsupported \\`${colorSpace}\\` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : _formatMuiErrorMessage(10, colorSpace));\n }\n } else {\n values = values.split(',');\n }\n values = values.map(value => parseFloat(value));\n return {\n type,\n values,\n colorSpace\n };\n}\n\n/**\n * Returns a channel created from the input color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {string} - The channel for the color, that can be used in rgba or hsla colors\n */\nexport const colorChannel = color => {\n const decomposedColor = decomposeColor(color);\n return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.indexOf('hsl') !== -1 && idx !== 0 ? `${val}%` : val).join(' ');\n};\nexport const private_safeColorChannel = (color, warning) => {\n try {\n return colorChannel(color);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n};\n\n/**\n * Converts a color object with type and values to a string.\n * @param {object} color - Decomposed color\n * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'\n * @param {array} color.values - [n,n,n] or [n,n,n,n]\n * @returns {string} A CSS color string\n */\nexport function recomposeColor(color) {\n const {\n type,\n colorSpace\n } = color;\n let {\n values\n } = color;\n if (type.indexOf('rgb') !== -1) {\n // Only convert the first 3 values to int (i.e. not alpha)\n values = values.map((n, i) => i < 3 ? parseInt(n, 10) : n);\n } else if (type.indexOf('hsl') !== -1) {\n values[1] = `${values[1]}%`;\n values[2] = `${values[2]}%`;\n }\n if (type.indexOf('color') !== -1) {\n values = `${colorSpace} ${values.join(' ')}`;\n } else {\n values = `${values.join(', ')}`;\n }\n return `${type}(${values})`;\n}\n\n/**\n * Converts a color from CSS rgb format to CSS hex format.\n * @param {string} color - RGB color, i.e. rgb(n, n, n)\n * @returns {string} A CSS rgb color string, i.e. #nnnnnn\n */\nexport function rgbToHex(color) {\n // Idempotent\n if (color.indexOf('#') === 0) {\n return color;\n }\n const {\n values\n } = decomposeColor(color);\n return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join('')}`;\n}\n\n/**\n * Converts a color from hsl format to rgb format.\n * @param {string} color - HSL color values\n * @returns {string} rgb color values\n */\nexport function hslToRgb(color) {\n color = decomposeColor(color);\n const {\n values\n } = color;\n const h = values[0];\n const s = values[1] / 100;\n const l = values[2] / 100;\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n let type = 'rgb';\n const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n if (color.type === 'hsla') {\n type += 'a';\n rgb.push(values[3]);\n }\n return recomposeColor({\n type,\n values: rgb\n });\n}\n/**\n * The relative brightness of any point in a color space,\n * normalized to 0 for darkest black and 1 for lightest white.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {number} The relative brightness of the color in the range 0 - 1\n */\nexport function getLuminance(color) {\n color = decomposeColor(color);\n let rgb = color.type === 'hsl' || color.type === 'hsla' ? decomposeColor(hslToRgb(color)).values : color.values;\n rgb = rgb.map(val => {\n if (color.type !== 'color') {\n val /= 255; // normalized\n }\n\n return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;\n });\n\n // Truncate at 3 digits\n return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));\n}\n\n/**\n * Calculates the contrast ratio between two colors.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} A contrast ratio value in the range 0 - 21.\n */\nexport function getContrastRatio(foreground, background) {\n const lumA = getLuminance(foreground);\n const lumB = getLuminance(background);\n return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);\n}\n\n/**\n * Sets the absolute transparency of a color.\n * Any existing alpha values are overwritten.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} value - value to set the alpha channel to in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function alpha(color, value) {\n color = decomposeColor(color);\n value = clamp(value);\n if (color.type === 'rgb' || color.type === 'hsl') {\n color.type += 'a';\n }\n if (color.type === 'color') {\n color.values[3] = `/${value}`;\n } else {\n color.values[3] = value;\n }\n return recomposeColor(color);\n}\nexport function private_safeAlpha(color, value, warning) {\n try {\n return alpha(color, value);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darkens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function darken(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clamp(coefficient);\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] *= 1 - coefficient;\n } else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] *= 1 - coefficient;\n }\n }\n return recomposeColor(color);\n}\nexport function private_safeDarken(color, coefficient, warning) {\n try {\n return darken(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Lightens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function lighten(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clamp(coefficient);\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] += (100 - color.values[2]) * coefficient;\n } else if (color.type.indexOf('rgb') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (255 - color.values[i]) * coefficient;\n }\n } else if (color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (1 - color.values[i]) * coefficient;\n }\n }\n return recomposeColor(color);\n}\nexport function private_safeLighten(color, coefficient, warning) {\n try {\n return lighten(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darken or lighten a color, depending on its luminance.\n * Light colors are darkened, dark colors are lightened.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient=0.15 - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function emphasize(color, coefficient = 0.15) {\n return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);\n}\nexport function private_safeEmphasize(color, coefficient, warning) {\n try {\n return private_safeEmphasize(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"variant\"];\nimport { unstable_capitalize as capitalize } from '@mui/utils';\nfunction isEmpty(string) {\n return string.length === 0;\n}\n\n/**\n * Generates string classKey based on the properties provided. It starts with the\n * variant if defined, and then it appends all other properties in alphabetical order.\n * @param {object} props - the properties for which the classKey should be created.\n */\nexport default function propsToClassKey(props) {\n const {\n variant\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n let classKey = variant || '';\n Object.keys(other).sort().forEach(key => {\n if (key === 'color') {\n classKey += isEmpty(classKey) ? props[key] : capitalize(props[key]);\n } else {\n classKey += `${isEmpty(classKey) ? key : capitalize(key)}${capitalize(props[key].toString())}`;\n }\n });\n return classKey;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"name\", \"slot\", \"skipVariantsResolver\", \"skipSx\", \"overridesResolver\"],\n _excluded2 = [\"theme\"],\n _excluded3 = [\"theme\"];\n/* eslint-disable no-underscore-dangle */\nimport styledEngineStyled, { internal_processStyles as processStyles } from '@mui/styled-engine';\nimport { getDisplayName } from '@mui/utils';\nimport createTheme from './createTheme';\nimport propsToClassKey from './propsToClassKey';\nimport styleFunctionSx from './styleFunctionSx';\nfunction isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\n\n// https://github.com/emotion-js/emotion/blob/26ded6109fcd8ca9875cc2ce4564fee678a3f3c5/packages/styled/src/utils.js#L40\nfunction isStringTag(tag) {\n return typeof tag === 'string' &&\n // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96;\n}\nconst getStyleOverrides = (name, theme) => {\n if (theme.components && theme.components[name] && theme.components[name].styleOverrides) {\n return theme.components[name].styleOverrides;\n }\n return null;\n};\nconst getVariantStyles = (name, theme) => {\n let variants = [];\n if (theme && theme.components && theme.components[name] && theme.components[name].variants) {\n variants = theme.components[name].variants;\n }\n const variantsStyles = {};\n variants.forEach(definition => {\n const key = propsToClassKey(definition.props);\n variantsStyles[key] = definition.style;\n });\n return variantsStyles;\n};\nconst variantsResolver = (props, styles, theme, name) => {\n var _theme$components, _theme$components$nam;\n const {\n ownerState = {}\n } = props;\n const variantsStyles = [];\n const themeVariants = theme == null ? void 0 : (_theme$components = theme.components) == null ? void 0 : (_theme$components$nam = _theme$components[name]) == null ? void 0 : _theme$components$nam.variants;\n if (themeVariants) {\n themeVariants.forEach(themeVariant => {\n let isMatch = true;\n Object.keys(themeVariant.props).forEach(key => {\n if (ownerState[key] !== themeVariant.props[key] && props[key] !== themeVariant.props[key]) {\n isMatch = false;\n }\n });\n if (isMatch) {\n variantsStyles.push(styles[propsToClassKey(themeVariant.props)]);\n }\n });\n }\n return variantsStyles;\n};\n\n// Update /system/styled/#api in case if this changes\nexport function shouldForwardProp(prop) {\n return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';\n}\nexport const systemDefaultTheme = createTheme();\nconst lowercaseFirstLetter = string => {\n return string.charAt(0).toLowerCase() + string.slice(1);\n};\nexport default function createStyled(input = {}) {\n const {\n defaultTheme = systemDefaultTheme,\n rootShouldForwardProp = shouldForwardProp,\n slotShouldForwardProp = shouldForwardProp\n } = input;\n const systemSx = props => {\n const theme = isEmpty(props.theme) ? defaultTheme : props.theme;\n return styleFunctionSx(_extends({}, props, {\n theme\n }));\n };\n systemSx.__mui_systemSx = true;\n return (tag, inputOptions = {}) => {\n // Filter out the `sx` style function from the previous styled component to prevent unnecessary styles generated by the composite components.\n processStyles(tag, styles => styles.filter(style => !(style != null && style.__mui_systemSx)));\n const {\n name: componentName,\n slot: componentSlot,\n skipVariantsResolver: inputSkipVariantsResolver,\n skipSx: inputSkipSx,\n overridesResolver\n } = inputOptions,\n options = _objectWithoutPropertiesLoose(inputOptions, _excluded);\n\n // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.\n const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;\n const skipSx = inputSkipSx || false;\n let label;\n if (process.env.NODE_ENV !== 'production') {\n if (componentName) {\n label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;\n }\n }\n let shouldForwardPropOption = shouldForwardProp;\n if (componentSlot === 'Root') {\n shouldForwardPropOption = rootShouldForwardProp;\n } else if (componentSlot) {\n // any other slot specified\n shouldForwardPropOption = slotShouldForwardProp;\n } else if (isStringTag(tag)) {\n // for string (html) tag, preserve the behavior in emotion & styled-components.\n shouldForwardPropOption = undefined;\n }\n const defaultStyledResolver = styledEngineStyled(tag, _extends({\n shouldForwardProp: shouldForwardPropOption,\n label\n }, options));\n const muiStyledResolver = (styleArg, ...expressions) => {\n const expressionsWithDefaultTheme = expressions ? expressions.map(stylesArg => {\n // On the server Emotion doesn't use React.forwardRef for creating components, so the created\n // component stays as a function. This condition makes sure that we do not interpolate functions\n // which are basically components used as a selectors.\n return typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg ? _ref => {\n let {\n theme: themeInput\n } = _ref,\n other = _objectWithoutPropertiesLoose(_ref, _excluded2);\n return stylesArg(_extends({\n theme: isEmpty(themeInput) ? defaultTheme : themeInput\n }, other));\n } : stylesArg;\n }) : [];\n let transformedStyleArg = styleArg;\n if (componentName && overridesResolver) {\n expressionsWithDefaultTheme.push(props => {\n const theme = isEmpty(props.theme) ? defaultTheme : props.theme;\n const styleOverrides = getStyleOverrides(componentName, theme);\n if (styleOverrides) {\n const resolvedStyleOverrides = {};\n Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {\n resolvedStyleOverrides[slotKey] = typeof slotStyle === 'function' ? slotStyle(_extends({}, props, {\n theme\n })) : slotStyle;\n });\n return overridesResolver(props, resolvedStyleOverrides);\n }\n return null;\n });\n }\n if (componentName && !skipVariantsResolver) {\n expressionsWithDefaultTheme.push(props => {\n const theme = isEmpty(props.theme) ? defaultTheme : props.theme;\n return variantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);\n });\n }\n if (!skipSx) {\n expressionsWithDefaultTheme.push(systemSx);\n }\n const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;\n if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {\n const placeholders = new Array(numOfCustomFnsApplied).fill('');\n // If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles.\n transformedStyleArg = [...styleArg, ...placeholders];\n transformedStyleArg.raw = [...styleArg.raw, ...placeholders];\n } else if (typeof styleArg === 'function' &&\n // On the server Emotion doesn't use React.forwardRef for creating components, so the created\n // component stays as a function. This condition makes sure that we do not interpolate functions\n // which are basically components used as a selectors.\n styleArg.__emotion_real !== styleArg) {\n // If the type is function, we need to define the default theme.\n transformedStyleArg = _ref2 => {\n let {\n theme: themeInput\n } = _ref2,\n other = _objectWithoutPropertiesLoose(_ref2, _excluded3);\n return styleArg(_extends({\n theme: isEmpty(themeInput) ? defaultTheme : themeInput\n }, other));\n };\n }\n const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);\n if (process.env.NODE_ENV !== 'production') {\n let displayName;\n if (componentName) {\n displayName = `${componentName}${componentSlot || ''}`;\n }\n if (displayName === undefined) {\n displayName = `Styled(${getDisplayName(tag)})`;\n }\n Component.displayName = displayName;\n }\n return Component;\n };\n if (defaultStyledResolver.withConfig) {\n muiStyledResolver.withConfig = defaultStyledResolver.withConfig;\n }\n return muiStyledResolver;\n };\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"values\", \"unit\", \"step\"];\n// Sorted ASC by size. That's important.\n// It can't be configured as it's used statically for propTypes.\nexport const breakpointKeys = ['xs', 'sm', 'md', 'lg', 'xl'];\nconst sortBreakpointsValues = values => {\n const breakpointsAsArray = Object.keys(values).map(key => ({\n key,\n val: values[key]\n })) || [];\n // Sort in ascending order\n breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);\n return breakpointsAsArray.reduce((acc, obj) => {\n return _extends({}, acc, {\n [obj.key]: obj.val\n });\n }, {});\n};\n\n// Keep in mind that @media is inclusive by the CSS specification.\nexport default function createBreakpoints(breakpoints) {\n const {\n // The breakpoint **start** at this value.\n // For instance with the first breakpoint xs: [xs, sm).\n values = {\n xs: 0,\n // phone\n sm: 600,\n // tablet\n md: 900,\n // small laptop\n lg: 1200,\n // desktop\n xl: 1536 // large screen\n },\n\n unit = 'px',\n step = 5\n } = breakpoints,\n other = _objectWithoutPropertiesLoose(breakpoints, _excluded);\n const sortedValues = sortBreakpointsValues(values);\n const keys = Object.keys(sortedValues);\n function up(key) {\n const value = typeof values[key] === 'number' ? values[key] : key;\n return `@media (min-width:${value}${unit})`;\n }\n function down(key) {\n const value = typeof values[key] === 'number' ? values[key] : key;\n return `@media (max-width:${value - step / 100}${unit})`;\n }\n function between(start, end) {\n const endIndex = keys.indexOf(end);\n return `@media (min-width:${typeof values[start] === 'number' ? values[start] : start}${unit}) and ` + `(max-width:${(endIndex !== -1 && typeof values[keys[endIndex]] === 'number' ? values[keys[endIndex]] : end) - step / 100}${unit})`;\n }\n function only(key) {\n if (keys.indexOf(key) + 1 < keys.length) {\n return between(key, keys[keys.indexOf(key) + 1]);\n }\n return up(key);\n }\n function not(key) {\n // handle first and last key separately, for better readability\n const keyIndex = keys.indexOf(key);\n if (keyIndex === 0) {\n return up(keys[1]);\n }\n if (keyIndex === keys.length - 1) {\n return down(keys[keyIndex]);\n }\n return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');\n }\n return _extends({\n keys,\n values: sortedValues,\n up,\n down,\n between,\n only,\n not,\n unit\n }, other);\n}","const shape = {\n borderRadius: 4\n};\nexport default shape;","import { createUnarySpacing } from '../spacing';\n/* tslint:enable:unified-signatures */\n\nexport default function createSpacing(spacingInput = 8) {\n // Already transformed.\n if (spacingInput.mui) {\n return spacingInput;\n }\n\n // Material Design layouts are visually balanced. Most measurements align to an 8dp grid, which aligns both spacing and the overall layout.\n // Smaller components, such as icons, can align to a 4dp grid.\n // https://m2.material.io/design/layout/understanding-layout.html\n const transform = createUnarySpacing({\n spacing: spacingInput\n });\n const spacing = (...argsInput) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!(argsInput.length <= 4)) {\n console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);\n }\n }\n const args = argsInput.length === 0 ? [1] : argsInput;\n return args.map(argument => {\n const output = transform(argument);\n return typeof output === 'number' ? `${output}px` : output;\n }).join(' ');\n };\n spacing.mui = true;\n return spacing;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"breakpoints\", \"palette\", \"spacing\", \"shape\"];\nimport { deepmerge } from '@mui/utils';\nimport createBreakpoints from './createBreakpoints';\nimport shape from './shape';\nimport createSpacing from './createSpacing';\nimport styleFunctionSx from '../styleFunctionSx/styleFunctionSx';\nimport defaultSxConfig from '../styleFunctionSx/defaultSxConfig';\nfunction createTheme(options = {}, ...args) {\n const {\n breakpoints: breakpointsInput = {},\n palette: paletteInput = {},\n spacing: spacingInput,\n shape: shapeInput = {}\n } = options,\n other = _objectWithoutPropertiesLoose(options, _excluded);\n const breakpoints = createBreakpoints(breakpointsInput);\n const spacing = createSpacing(spacingInput);\n let muiTheme = deepmerge({\n breakpoints,\n direction: 'ltr',\n components: {},\n // Inject component definitions.\n palette: _extends({\n mode: 'light'\n }, paletteInput),\n spacing,\n shape: _extends({}, shape, shapeInput)\n }, other);\n muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);\n muiTheme.unstable_sxConfig = _extends({}, defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);\n muiTheme.unstable_sx = function sx(props) {\n return styleFunctionSx({\n sx: props,\n theme: this\n });\n };\n return muiTheme;\n}\nexport default createTheme;","import { deepmerge } from '@mui/utils';\nfunction merge(acc, item) {\n if (!item) {\n return acc;\n }\n return deepmerge(acc, item, {\n clone: false // No need to clone deep, it's way faster.\n });\n}\n\nexport default merge;","import responsivePropType from './responsivePropType';\nimport { handleBreakpoints } from './breakpoints';\nimport { getPath } from './style';\nimport merge from './merge';\nimport memoize from './memoize';\nconst properties = {\n m: 'margin',\n p: 'padding'\n};\nconst directions = {\n t: 'Top',\n r: 'Right',\n b: 'Bottom',\n l: 'Left',\n x: ['Left', 'Right'],\n y: ['Top', 'Bottom']\n};\nconst aliases = {\n marginX: 'mx',\n marginY: 'my',\n paddingX: 'px',\n paddingY: 'py'\n};\n\n// memoize() impact:\n// From 300,000 ops/sec\n// To 350,000 ops/sec\nconst getCssProperties = memoize(prop => {\n // It's not a shorthand notation.\n if (prop.length > 2) {\n if (aliases[prop]) {\n prop = aliases[prop];\n } else {\n return [prop];\n }\n }\n const [a, b] = prop.split('');\n const property = properties[a];\n const direction = directions[b] || '';\n return Array.isArray(direction) ? direction.map(dir => property + dir) : [property + direction];\n});\nexport const marginKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'marginInline', 'marginInlineStart', 'marginInlineEnd', 'marginBlock', 'marginBlockStart', 'marginBlockEnd'];\nexport const paddingKeys = ['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd'];\nconst spacingKeys = [...marginKeys, ...paddingKeys];\nexport function createUnaryUnit(theme, themeKey, defaultValue, propName) {\n var _getPath;\n const themeSpacing = (_getPath = getPath(theme, themeKey, false)) != null ? _getPath : defaultValue;\n if (typeof themeSpacing === 'number') {\n return abs => {\n if (typeof abs === 'string') {\n return abs;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (typeof abs !== 'number') {\n console.error(`MUI: Expected ${propName} argument to be a number or a string, got ${abs}.`);\n }\n }\n return themeSpacing * abs;\n };\n }\n if (Array.isArray(themeSpacing)) {\n return abs => {\n if (typeof abs === 'string') {\n return abs;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (!Number.isInteger(abs)) {\n console.error([`MUI: The \\`theme.${themeKey}\\` array type cannot be combined with non integer values.` + `You should either use an integer value that can be used as index, or define the \\`theme.${themeKey}\\` as a number.`].join('\\n'));\n } else if (abs > themeSpacing.length - 1) {\n console.error([`MUI: The value provided (${abs}) overflows.`, `The supported values are: ${JSON.stringify(themeSpacing)}.`, `${abs} > ${themeSpacing.length - 1}, you need to add the missing values.`].join('\\n'));\n }\n }\n return themeSpacing[abs];\n };\n }\n if (typeof themeSpacing === 'function') {\n return themeSpacing;\n }\n if (process.env.NODE_ENV !== 'production') {\n console.error([`MUI: The \\`theme.${themeKey}\\` value (${themeSpacing}) is invalid.`, 'It should be a number, an array or a function.'].join('\\n'));\n }\n return () => undefined;\n}\nexport function createUnarySpacing(theme) {\n return createUnaryUnit(theme, 'spacing', 8, 'spacing');\n}\nexport function getValue(transformer, propValue) {\n if (typeof propValue === 'string' || propValue == null) {\n return propValue;\n }\n const abs = Math.abs(propValue);\n const transformed = transformer(abs);\n if (propValue >= 0) {\n return transformed;\n }\n if (typeof transformed === 'number') {\n return -transformed;\n }\n return `-${transformed}`;\n}\nexport function getStyleFromPropValue(cssProperties, transformer) {\n return propValue => cssProperties.reduce((acc, cssProperty) => {\n acc[cssProperty] = getValue(transformer, propValue);\n return acc;\n }, {});\n}\nfunction resolveCssProperty(props, keys, prop, transformer) {\n // Using a hash computation over an array iteration could be faster, but with only 28 items,\n // it's doesn't worth the bundle size.\n if (keys.indexOf(prop) === -1) {\n return null;\n }\n const cssProperties = getCssProperties(prop);\n const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);\n const propValue = props[prop];\n return handleBreakpoints(props, propValue, styleFromPropValue);\n}\nfunction style(props, keys) {\n const transformer = createUnarySpacing(props.theme);\n return Object.keys(props).map(prop => resolveCssProperty(props, keys, prop, transformer)).reduce(merge, {});\n}\nexport function margin(props) {\n return style(props, marginKeys);\n}\nmargin.propTypes = process.env.NODE_ENV !== 'production' ? marginKeys.reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\nmargin.filterProps = marginKeys;\nexport function padding(props) {\n return style(props, paddingKeys);\n}\npadding.propTypes = process.env.NODE_ENV !== 'production' ? paddingKeys.reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\npadding.filterProps = paddingKeys;\nfunction spacing(props) {\n return style(props, spacingKeys);\n}\nspacing.propTypes = process.env.NODE_ENV !== 'production' ? spacingKeys.reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\nspacing.filterProps = spacingKeys;\nexport default spacing;","export default function memoize(fn) {\n const cache = {};\n return arg => {\n if (cache[arg] === undefined) {\n cache[arg] = fn(arg);\n }\n return cache[arg];\n };\n}","import { unstable_capitalize as capitalize } from '@mui/utils';\nimport responsivePropType from './responsivePropType';\nimport { handleBreakpoints } from './breakpoints';\nexport function getPath(obj, path, checkVars = true) {\n if (!path || typeof path !== 'string') {\n return null;\n }\n\n // Check if CSS variables are used\n if (obj && obj.vars && checkVars) {\n const val = `vars.${path}`.split('.').reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);\n if (val != null) {\n return val;\n }\n }\n return path.split('.').reduce((acc, item) => {\n if (acc && acc[item] != null) {\n return acc[item];\n }\n return null;\n }, obj);\n}\nexport function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {\n let value;\n if (typeof themeMapping === 'function') {\n value = themeMapping(propValueFinal);\n } else if (Array.isArray(themeMapping)) {\n value = themeMapping[propValueFinal] || userValue;\n } else {\n value = getPath(themeMapping, propValueFinal) || userValue;\n }\n if (transform) {\n value = transform(value, userValue, themeMapping);\n }\n return value;\n}\nfunction style(options) {\n const {\n prop,\n cssProperty = options.prop,\n themeKey,\n transform\n } = options;\n\n // false positive\n // eslint-disable-next-line react/function-component-definition\n const fn = props => {\n if (props[prop] == null) {\n return null;\n }\n const propValue = props[prop];\n const theme = props.theme;\n const themeMapping = getPath(theme, themeKey) || {};\n const styleFromPropValue = propValueFinal => {\n let value = getStyleValue(themeMapping, transform, propValueFinal);\n if (propValueFinal === value && typeof propValueFinal === 'string') {\n // Haven't found value\n value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);\n }\n if (cssProperty === false) {\n return value;\n }\n return {\n [cssProperty]: value\n };\n };\n return handleBreakpoints(props, propValue, styleFromPropValue);\n };\n fn.propTypes = process.env.NODE_ENV !== 'production' ? {\n [prop]: responsivePropType\n } : {};\n fn.filterProps = [prop];\n return fn;\n}\nexport default style;","import merge from './merge';\nfunction compose(...styles) {\n const handlers = styles.reduce((acc, style) => {\n style.filterProps.forEach(prop => {\n acc[prop] = style;\n });\n return acc;\n }, {});\n\n // false positive\n // eslint-disable-next-line react/function-component-definition\n const fn = props => {\n return Object.keys(props).reduce((acc, prop) => {\n if (handlers[prop]) {\n return merge(acc, handlers[prop](props));\n }\n return acc;\n }, {});\n };\n fn.propTypes = process.env.NODE_ENV !== 'production' ? styles.reduce((acc, style) => Object.assign(acc, style.propTypes), {}) : {};\n fn.filterProps = styles.reduce((acc, style) => acc.concat(style.filterProps), []);\n return fn;\n}\nexport default compose;","import responsivePropType from './responsivePropType';\nimport style from './style';\nimport compose from './compose';\nimport { createUnaryUnit, getValue } from './spacing';\nimport { handleBreakpoints } from './breakpoints';\nexport function borderTransform(value) {\n if (typeof value !== 'number') {\n return value;\n }\n return `${value}px solid`;\n}\nexport const border = style({\n prop: 'border',\n themeKey: 'borders',\n transform: borderTransform\n});\nexport const borderTop = style({\n prop: 'borderTop',\n themeKey: 'borders',\n transform: borderTransform\n});\nexport const borderRight = style({\n prop: 'borderRight',\n themeKey: 'borders',\n transform: borderTransform\n});\nexport const borderBottom = style({\n prop: 'borderBottom',\n themeKey: 'borders',\n transform: borderTransform\n});\nexport const borderLeft = style({\n prop: 'borderLeft',\n themeKey: 'borders',\n transform: borderTransform\n});\nexport const borderColor = style({\n prop: 'borderColor',\n themeKey: 'palette'\n});\nexport const borderTopColor = style({\n prop: 'borderTopColor',\n themeKey: 'palette'\n});\nexport const borderRightColor = style({\n prop: 'borderRightColor',\n themeKey: 'palette'\n});\nexport const borderBottomColor = style({\n prop: 'borderBottomColor',\n themeKey: 'palette'\n});\nexport const borderLeftColor = style({\n prop: 'borderLeftColor',\n themeKey: 'palette'\n});\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nexport const borderRadius = props => {\n if (props.borderRadius !== undefined && props.borderRadius !== null) {\n const transformer = createUnaryUnit(props.theme, 'shape.borderRadius', 4, 'borderRadius');\n const styleFromPropValue = propValue => ({\n borderRadius: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.borderRadius, styleFromPropValue);\n }\n return null;\n};\nborderRadius.propTypes = process.env.NODE_ENV !== 'production' ? {\n borderRadius: responsivePropType\n} : {};\nborderRadius.filterProps = ['borderRadius'];\nconst borders = compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius);\nexport default borders;","import style from './style';\nimport compose from './compose';\nimport { createUnaryUnit, getValue } from './spacing';\nimport { handleBreakpoints } from './breakpoints';\nimport responsivePropType from './responsivePropType';\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nexport const gap = props => {\n if (props.gap !== undefined && props.gap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'gap');\n const styleFromPropValue = propValue => ({\n gap: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.gap, styleFromPropValue);\n }\n return null;\n};\ngap.propTypes = process.env.NODE_ENV !== 'production' ? {\n gap: responsivePropType\n} : {};\ngap.filterProps = ['gap'];\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nexport const columnGap = props => {\n if (props.columnGap !== undefined && props.columnGap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'columnGap');\n const styleFromPropValue = propValue => ({\n columnGap: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.columnGap, styleFromPropValue);\n }\n return null;\n};\ncolumnGap.propTypes = process.env.NODE_ENV !== 'production' ? {\n columnGap: responsivePropType\n} : {};\ncolumnGap.filterProps = ['columnGap'];\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nexport const rowGap = props => {\n if (props.rowGap !== undefined && props.rowGap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'rowGap');\n const styleFromPropValue = propValue => ({\n rowGap: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.rowGap, styleFromPropValue);\n }\n return null;\n};\nrowGap.propTypes = process.env.NODE_ENV !== 'production' ? {\n rowGap: responsivePropType\n} : {};\nrowGap.filterProps = ['rowGap'];\nexport const gridColumn = style({\n prop: 'gridColumn'\n});\nexport const gridRow = style({\n prop: 'gridRow'\n});\nexport const gridAutoFlow = style({\n prop: 'gridAutoFlow'\n});\nexport const gridAutoColumns = style({\n prop: 'gridAutoColumns'\n});\nexport const gridAutoRows = style({\n prop: 'gridAutoRows'\n});\nexport const gridTemplateColumns = style({\n prop: 'gridTemplateColumns'\n});\nexport const gridTemplateRows = style({\n prop: 'gridTemplateRows'\n});\nexport const gridTemplateAreas = style({\n prop: 'gridTemplateAreas'\n});\nexport const gridArea = style({\n prop: 'gridArea'\n});\nconst grid = compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);\nexport default grid;","import style from './style';\nimport compose from './compose';\nexport function paletteTransform(value, userValue) {\n if (userValue === 'grey') {\n return userValue;\n }\n return value;\n}\nexport const color = style({\n prop: 'color',\n themeKey: 'palette',\n transform: paletteTransform\n});\nexport const bgcolor = style({\n prop: 'bgcolor',\n cssProperty: 'backgroundColor',\n themeKey: 'palette',\n transform: paletteTransform\n});\nexport const backgroundColor = style({\n prop: 'backgroundColor',\n themeKey: 'palette',\n transform: paletteTransform\n});\nconst palette = compose(color, bgcolor, backgroundColor);\nexport default palette;","import style from './style';\nimport compose from './compose';\nimport { handleBreakpoints, values as breakpointsValues } from './breakpoints';\nexport function sizingTransform(value) {\n return value <= 1 && value !== 0 ? `${value * 100}%` : value;\n}\nexport const width = style({\n prop: 'width',\n transform: sizingTransform\n});\nexport const maxWidth = props => {\n if (props.maxWidth !== undefined && props.maxWidth !== null) {\n const styleFromPropValue = propValue => {\n var _props$theme, _props$theme$breakpoi, _props$theme$breakpoi2;\n const breakpoint = ((_props$theme = props.theme) == null ? void 0 : (_props$theme$breakpoi = _props$theme.breakpoints) == null ? void 0 : (_props$theme$breakpoi2 = _props$theme$breakpoi.values) == null ? void 0 : _props$theme$breakpoi2[propValue]) || breakpointsValues[propValue];\n return {\n maxWidth: breakpoint || sizingTransform(propValue)\n };\n };\n return handleBreakpoints(props, props.maxWidth, styleFromPropValue);\n }\n return null;\n};\nmaxWidth.filterProps = ['maxWidth'];\nexport const minWidth = style({\n prop: 'minWidth',\n transform: sizingTransform\n});\nexport const height = style({\n prop: 'height',\n transform: sizingTransform\n});\nexport const maxHeight = style({\n prop: 'maxHeight',\n transform: sizingTransform\n});\nexport const minHeight = style({\n prop: 'minHeight',\n transform: sizingTransform\n});\nexport const sizeWidth = style({\n prop: 'size',\n cssProperty: 'width',\n transform: sizingTransform\n});\nexport const sizeHeight = style({\n prop: 'size',\n cssProperty: 'height',\n transform: sizingTransform\n});\nexport const boxSizing = style({\n prop: 'boxSizing'\n});\nconst sizing = compose(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);\nexport default sizing;","import { padding, margin } from '../spacing';\nimport { borderRadius, borderTransform } from '../borders';\nimport { gap, rowGap, columnGap } from '../cssGrid';\nimport { paletteTransform } from '../palette';\nimport { maxWidth, sizingTransform } from '../sizing';\nconst defaultSxConfig = {\n // borders\n border: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderTop: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderRight: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderBottom: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderLeft: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderColor: {\n themeKey: 'palette'\n },\n borderTopColor: {\n themeKey: 'palette'\n },\n borderRightColor: {\n themeKey: 'palette'\n },\n borderBottomColor: {\n themeKey: 'palette'\n },\n borderLeftColor: {\n themeKey: 'palette'\n },\n borderRadius: {\n themeKey: 'shape.borderRadius',\n style: borderRadius\n },\n // palette\n color: {\n themeKey: 'palette',\n transform: paletteTransform\n },\n bgcolor: {\n themeKey: 'palette',\n cssProperty: 'backgroundColor',\n transform: paletteTransform\n },\n backgroundColor: {\n themeKey: 'palette',\n transform: paletteTransform\n },\n // spacing\n p: {\n style: padding\n },\n pt: {\n style: padding\n },\n pr: {\n style: padding\n },\n pb: {\n style: padding\n },\n pl: {\n style: padding\n },\n px: {\n style: padding\n },\n py: {\n style: padding\n },\n padding: {\n style: padding\n },\n paddingTop: {\n style: padding\n },\n paddingRight: {\n style: padding\n },\n paddingBottom: {\n style: padding\n },\n paddingLeft: {\n style: padding\n },\n paddingX: {\n style: padding\n },\n paddingY: {\n style: padding\n },\n paddingInline: {\n style: padding\n },\n paddingInlineStart: {\n style: padding\n },\n paddingInlineEnd: {\n style: padding\n },\n paddingBlock: {\n style: padding\n },\n paddingBlockStart: {\n style: padding\n },\n paddingBlockEnd: {\n style: padding\n },\n m: {\n style: margin\n },\n mt: {\n style: margin\n },\n mr: {\n style: margin\n },\n mb: {\n style: margin\n },\n ml: {\n style: margin\n },\n mx: {\n style: margin\n },\n my: {\n style: margin\n },\n margin: {\n style: margin\n },\n marginTop: {\n style: margin\n },\n marginRight: {\n style: margin\n },\n marginBottom: {\n style: margin\n },\n marginLeft: {\n style: margin\n },\n marginX: {\n style: margin\n },\n marginY: {\n style: margin\n },\n marginInline: {\n style: margin\n },\n marginInlineStart: {\n style: margin\n },\n marginInlineEnd: {\n style: margin\n },\n marginBlock: {\n style: margin\n },\n marginBlockStart: {\n style: margin\n },\n marginBlockEnd: {\n style: margin\n },\n // display\n displayPrint: {\n cssProperty: false,\n transform: value => ({\n '@media print': {\n display: value\n }\n })\n },\n display: {},\n overflow: {},\n textOverflow: {},\n visibility: {},\n whiteSpace: {},\n // flexbox\n flexBasis: {},\n flexDirection: {},\n flexWrap: {},\n justifyContent: {},\n alignItems: {},\n alignContent: {},\n order: {},\n flex: {},\n flexGrow: {},\n flexShrink: {},\n alignSelf: {},\n justifyItems: {},\n justifySelf: {},\n // grid\n gap: {\n style: gap\n },\n rowGap: {\n style: rowGap\n },\n columnGap: {\n style: columnGap\n },\n gridColumn: {},\n gridRow: {},\n gridAutoFlow: {},\n gridAutoColumns: {},\n gridAutoRows: {},\n gridTemplateColumns: {},\n gridTemplateRows: {},\n gridTemplateAreas: {},\n gridArea: {},\n // positions\n position: {},\n zIndex: {\n themeKey: 'zIndex'\n },\n top: {},\n right: {},\n bottom: {},\n left: {},\n // shadows\n boxShadow: {\n themeKey: 'shadows'\n },\n // sizing\n width: {\n transform: sizingTransform\n },\n maxWidth: {\n style: maxWidth\n },\n minWidth: {\n transform: sizingTransform\n },\n height: {\n transform: sizingTransform\n },\n maxHeight: {\n transform: sizingTransform\n },\n minHeight: {\n transform: sizingTransform\n },\n boxSizing: {},\n // typography\n fontFamily: {\n themeKey: 'typography'\n },\n fontSize: {\n themeKey: 'typography'\n },\n fontStyle: {\n themeKey: 'typography'\n },\n fontWeight: {\n themeKey: 'typography'\n },\n letterSpacing: {},\n textTransform: {},\n lineHeight: {},\n textAlign: {},\n typography: {\n cssProperty: false,\n themeKey: 'typography'\n }\n};\nexport default defaultSxConfig;","import { unstable_capitalize as capitalize } from '@mui/utils';\nimport merge from '../merge';\nimport { getPath, getStyleValue as getValue } from '../style';\nimport { handleBreakpoints, createEmptyBreakpointObject, removeUnusedBreakpoints } from '../breakpoints';\nimport defaultSxConfig from './defaultSxConfig';\nfunction objectsHaveSameKeys(...objects) {\n const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);\n const union = new Set(allKeys);\n return objects.every(object => union.size === Object.keys(object).length);\n}\nfunction callIfFn(maybeFn, arg) {\n return typeof maybeFn === 'function' ? maybeFn(arg) : maybeFn;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function unstable_createStyleFunctionSx() {\n function getThemeValue(prop, val, theme, config) {\n const props = {\n [prop]: val,\n theme\n };\n const options = config[prop];\n if (!options) {\n return {\n [prop]: val\n };\n }\n const {\n cssProperty = prop,\n themeKey,\n transform,\n style\n } = options;\n if (val == null) {\n return null;\n }\n const themeMapping = getPath(theme, themeKey) || {};\n if (style) {\n return style(props);\n }\n const styleFromPropValue = propValueFinal => {\n let value = getValue(themeMapping, transform, propValueFinal);\n if (propValueFinal === value && typeof propValueFinal === 'string') {\n // Haven't found value\n value = getValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);\n }\n if (cssProperty === false) {\n return value;\n }\n return {\n [cssProperty]: value\n };\n };\n return handleBreakpoints(props, val, styleFromPropValue);\n }\n function styleFunctionSx(props) {\n var _theme$unstable_sxCon;\n const {\n sx,\n theme = {}\n } = props || {};\n if (!sx) {\n return null; // Emotion & styled-components will neglect null\n }\n\n const config = (_theme$unstable_sxCon = theme.unstable_sxConfig) != null ? _theme$unstable_sxCon : defaultSxConfig;\n\n /*\n * Receive `sxInput` as object or callback\n * and then recursively check keys & values to create media query object styles.\n * (the result will be used in `styled`)\n */\n function traverse(sxInput) {\n let sxObject = sxInput;\n if (typeof sxInput === 'function') {\n sxObject = sxInput(theme);\n } else if (typeof sxInput !== 'object') {\n // value\n return sxInput;\n }\n if (!sxObject) {\n return null;\n }\n const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);\n const breakpointsKeys = Object.keys(emptyBreakpoints);\n let css = emptyBreakpoints;\n Object.keys(sxObject).forEach(styleKey => {\n const value = callIfFn(sxObject[styleKey], theme);\n if (value !== null && value !== undefined) {\n if (typeof value === 'object') {\n if (config[styleKey]) {\n css = merge(css, getThemeValue(styleKey, value, theme, config));\n } else {\n const breakpointsValues = handleBreakpoints({\n theme\n }, value, x => ({\n [styleKey]: x\n }));\n if (objectsHaveSameKeys(breakpointsValues, value)) {\n css[styleKey] = styleFunctionSx({\n sx: value,\n theme\n });\n } else {\n css = merge(css, breakpointsValues);\n }\n }\n } else {\n css = merge(css, getThemeValue(styleKey, value, theme, config));\n }\n }\n });\n return removeUnusedBreakpoints(breakpointsKeys, css);\n }\n return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);\n }\n return styleFunctionSx;\n}\nconst styleFunctionSx = unstable_createStyleFunctionSx();\nstyleFunctionSx.filterProps = ['sx'];\nexport default styleFunctionSx;","import createTheme from './createTheme';\nimport useThemeWithoutDefault from './useThemeWithoutDefault';\nexport const systemDefaultTheme = createTheme();\nfunction useTheme(defaultTheme = systemDefaultTheme) {\n return useThemeWithoutDefault(defaultTheme);\n}\nexport default useTheme;","import * as React from 'react';\nconst ThemeContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== 'production') {\n ThemeContext.displayName = 'ThemeContext';\n}\nexport default ThemeContext;","import * as React from 'react';\nimport ThemeContext from './ThemeContext';\nexport default function useTheme() {\n const theme = React.useContext(ThemeContext);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(theme);\n }\n return theme;\n}","import { useTheme as muiUseTheme } from '@mui/private-theming';\nfunction isObjectEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction useTheme(defaultTheme = null) {\n const contextTheme = muiUseTheme();\n return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;\n}\nexport default useTheme;","const defaultGenerator = componentName => componentName;\nconst createClassNameGenerator = () => {\n let generate = defaultGenerator;\n return {\n configure(generator) {\n generate = generator;\n },\n generate(componentName) {\n return generate(componentName);\n },\n reset() {\n generate = defaultGenerator;\n }\n };\n};\nconst ClassNameGenerator = createClassNameGenerator();\nexport default ClassNameGenerator;","import _formatMuiErrorMessage from \"./formatMuiErrorMessage\";\n// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.\n//\n// A strict capitalization should uppercase the first letter of each word in the sentence.\n// We only handle the first word.\nexport default function capitalize(string) {\n if (typeof string !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: \\`capitalize(string)\\` expects a string argument.` : _formatMuiErrorMessage(7));\n }\n return string.charAt(0).toUpperCase() + string.slice(1);\n}","export default function composeClasses(slots, getUtilityClass, classes) {\n const output = {};\n Object.keys(slots).forEach(\n // `Objet.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.\n // @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208\n slot => {\n output[slot] = slots[slot].reduce((acc, key) => {\n if (key) {\n acc.push(getUtilityClass(key));\n if (classes && classes[key]) {\n acc.push(classes[key]);\n }\n }\n return acc;\n }, []).join(' ');\n });\n return output;\n}","/**\n * Safe chained function.\n *\n * Will only create a new function if needed,\n * otherwise will pass back existing functions or null.\n */\nexport default function createChainedFunction(...funcs) {\n return funcs.reduce((acc, func) => {\n if (func == null) {\n return acc;\n }\n return function chainedFunction(...args) {\n acc.apply(this, args);\n func.apply(this, args);\n };\n }, () => {});\n}","// Corresponds to 10 frames at 60 Hz.\n// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.\nexport default function debounce(func, wait = 166) {\n let timeout;\n function debounced(...args) {\n const later = () => {\n func.apply(this, args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n debounced.clear = () => {\n clearTimeout(timeout);\n };\n return debounced;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nexport function isPlainObject(item) {\n return item !== null && typeof item === 'object' && item.constructor === Object;\n}\nfunction deepClone(source) {\n if (!isPlainObject(source)) {\n return source;\n }\n const output = {};\n Object.keys(source).forEach(key => {\n output[key] = deepClone(source[key]);\n });\n return output;\n}\nexport default function deepmerge(target, source, options = {\n clone: true\n}) {\n const output = options.clone ? _extends({}, target) : target;\n if (isPlainObject(target) && isPlainObject(source)) {\n Object.keys(source).forEach(key => {\n // Avoid prototype pollution\n if (key === '__proto__') {\n return;\n }\n if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {\n // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.\n output[key] = deepmerge(target[key], source[key], options);\n } else if (options.clone) {\n output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key];\n } else {\n output[key] = source[key];\n }\n });\n }\n return output;\n}","/**\n * WARNING: Don't import this directly.\n * Use `MuiError` from `@mui/utils/macros/MuiError.macro` instead.\n * @param {number} code\n */\nexport default function formatMuiErrorMessage(code) {\n // Apply babel-plugin-transform-template-literals in loose mode\n // loose mode is safe iff we're concatenating primitives\n // see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose\n /* eslint-disable prefer-template */\n let url = 'https://mui.com/production-error/?code=' + code;\n for (let i = 1; i < arguments.length; i += 1) {\n // rest params over-transpile for this case\n // eslint-disable-next-line prefer-rest-params\n url += '&args[]=' + encodeURIComponent(arguments[i]);\n }\n return 'Minified MUI error #' + code + '; visit ' + url + ' for the full message.';\n /* eslint-enable prefer-template */\n}","import ClassNameGenerator from '../ClassNameGenerator';\nconst globalStateClassesMapping = {\n active: 'active',\n checked: 'checked',\n completed: 'completed',\n disabled: 'disabled',\n error: 'error',\n expanded: 'expanded',\n focused: 'focused',\n focusVisible: 'focusVisible',\n required: 'required',\n selected: 'selected'\n};\nexport default function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {\n const globalStateClass = globalStateClassesMapping[slot];\n return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;\n}","import generateUtilityClass from '../generateUtilityClass';\nexport default function generateUtilityClasses(componentName, slots, globalStatePrefix = 'Mui') {\n const result = {};\n slots.forEach(slot => {\n result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);\n });\n return result;\n}","export default function ownerDocument(node) {\n return node && node.ownerDocument || document;\n}","import ownerDocument from './ownerDocument';\nexport default function ownerWindow(node) {\n const doc = ownerDocument(node);\n return doc.defaultView || window;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\n/**\n * Add keys, values of `defaultProps` that does not exist in `props`\n * @param {object} defaultProps\n * @param {object} props\n * @returns {object} resolved props\n */\nexport default function resolveProps(defaultProps, props) {\n const output = _extends({}, props);\n Object.keys(defaultProps).forEach(propName => {\n if (propName.toString().match(/^(components|slots)$/)) {\n output[propName] = _extends({}, defaultProps[propName], output[propName]);\n } else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {\n const defaultSlotProps = defaultProps[propName] || {};\n const slotProps = props[propName];\n output[propName] = {};\n if (!slotProps || !Object.keys(slotProps)) {\n // Reduce the iteration if the slot props is empty\n output[propName] = defaultSlotProps;\n } else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {\n // Reduce the iteration if the default slot props is empty\n output[propName] = slotProps;\n } else {\n output[propName] = _extends({}, slotProps);\n Object.keys(defaultSlotProps).forEach(slotPropName => {\n output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);\n });\n }\n } else if (output[propName] === undefined) {\n output[propName] = defaultProps[propName];\n }\n });\n return output;\n}","/**\n * TODO v5: consider making it private\n *\n * passes {value} to {ref}\n *\n * WARNING: Be sure to only call this inside a callback that is passed as a ref.\n * Otherwise, make sure to cleanup the previous {ref} if it changes. See\n * https://github.com/mui/material-ui/issues/13539\n *\n * Useful if you want to expose the ref of an inner component to the public API\n * while still using it inside the component.\n * @param ref A ref callback or ref object. If anything falsy, this is a no-op.\n */\nexport default function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}","/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nexport default function useControlled({\n controlled,\n default: defaultProp,\n name,\n state = 'value'\n}) {\n // isControlled is ignored in the hook dependency lists as it should never change.\n const {\n current: isControlled\n } = React.useRef(controlled !== undefined);\n const [valueState, setValue] = React.useState(defaultProp);\n const value = isControlled ? controlled : valueState;\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(() => {\n if (isControlled !== (controlled !== undefined)) {\n console.error([`MUI: A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n }\n }, [state, name, controlled]);\n const {\n current: defaultValue\n } = React.useRef(defaultProp);\n React.useEffect(() => {\n if (!isControlled && defaultValue !== defaultProp) {\n console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\\n'));\n }\n }, [JSON.stringify(defaultProp)]);\n }\n const setValueIfUncontrolled = React.useCallback(newValue => {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}","import * as React from 'react';\nconst useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nexport default useEnhancedEffect;","import * as React from 'react';\nimport useEnhancedEffect from './useEnhancedEffect';\n\n/**\n * https://github.com/facebook/react/issues/14099#issuecomment-440013892\n */\nexport default function useEventCallback(fn) {\n const ref = React.useRef(fn);\n useEnhancedEffect(() => {\n ref.current = fn;\n });\n return React.useCallback((...args) =>\n // @ts-expect-error hide `this`\n // tslint:disable-next-line:ban-comma-operator\n (0, ref.current)(...args), []);\n}","import * as React from 'react';\nimport setRef from './setRef';\nexport default function useForkRef(...refs) {\n /**\n * This will create a new function if the refs passed to this hook change and are all defined.\n * This means react will call the old forkRef with `null` and the new forkRef\n * with the ref. Cleanup naturally emerges from this behavior.\n */\n return React.useMemo(() => {\n if (refs.every(ref => ref == null)) {\n return null;\n }\n return instance => {\n refs.forEach(ref => {\n setRef(ref, instance);\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, refs);\n}","import * as React from 'react';\nlet globalId = 0;\nfunction useGlobalId(idOverride) {\n const [defaultId, setDefaultId] = React.useState(idOverride);\n const id = idOverride || defaultId;\n React.useEffect(() => {\n if (defaultId == null) {\n // Fallback to this default id when possible.\n // Use the incrementing value for client-side rendering only.\n // We can't use it server-side.\n // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem\n globalId += 1;\n setDefaultId(`mui-${globalId}`);\n }\n }, [defaultId]);\n return id;\n}\n\n// eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814\nconst maybeReactUseId = React['useId' + ''];\n/**\n *\n * @example
    \n * @param idOverride\n * @returns {string}\n */\nexport default function useId(idOverride) {\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride != null ? idOverride : reactId;\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride);\n}","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n this._bodyInit = body;\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n };\n }\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = 'statusText' in options ? options.statusText : 'OK';\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''});\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = self.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options));\n };\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.onabort = function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n };\n\n xhr.open(request.method, request.url, true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob';\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!self.fetch) {\n self.fetch = fetch;\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n return exports;\n\n}({}));\n})(__self__);\n__self__.fetch.ponyfill = true;\n// Remove \"polyfill\" property added by whatwg-fetch\ndelete __self__.fetch.polyfill;\n// Choose between native implementation (global) or custom implementation (__self__)\n// var ctx = global.fetch ? global : __self__;\nvar ctx = __self__; // this line disable service worker support temporarily\nexports = ctx.fetch // To enable: import fetch from 'cross-fetch'\nexports.default = ctx.fetch // For TypeScript consumers without esModuleInterop.\nexports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch'\nexports.Headers = ctx.Headers\nexports.Request = ctx.Request\nexports.Response = ctx.Response\nmodule.exports = exports\n","'use strict';\n\nmodule.exports = function ReactNativeFile(_ref) {\n var uri = _ref.uri,\n name = _ref.name,\n type = _ref.type;\n this.uri = uri;\n this.name = name;\n this.type = type;\n};\n","'use strict';\n\nvar defaultIsExtractableFile = require('./isExtractableFile');\n\nmodule.exports = function extractFiles(value, path, isExtractableFile) {\n if (path === void 0) {\n path = '';\n }\n\n if (isExtractableFile === void 0) {\n isExtractableFile = defaultIsExtractableFile;\n }\n\n var clone;\n var files = new Map();\n\n function addFile(paths, file) {\n var storedPaths = files.get(file);\n if (storedPaths) storedPaths.push.apply(storedPaths, paths);\n else files.set(file, paths);\n }\n\n if (isExtractableFile(value)) {\n clone = null;\n addFile([path], value);\n } else {\n var prefix = path ? path + '.' : '';\n if (typeof FileList !== 'undefined' && value instanceof FileList)\n clone = Array.prototype.map.call(value, function (file, i) {\n addFile(['' + prefix + i], file);\n return null;\n });\n else if (Array.isArray(value))\n clone = value.map(function (child, i) {\n var result = extractFiles(child, '' + prefix + i, isExtractableFile);\n result.files.forEach(addFile);\n return result.clone;\n });\n else if (value && value.constructor === Object) {\n clone = {};\n\n for (var i in value) {\n var result = extractFiles(value[i], '' + prefix + i, isExtractableFile);\n result.files.forEach(addFile);\n clone[i] = result.clone;\n }\n } else clone = value;\n }\n\n return {\n clone: clone,\n files: files,\n };\n};\n","'use strict';\n\nexports.ReactNativeFile = require('./ReactNativeFile');\nexports.extractFiles = require('./extractFiles');\nexports.isExtractableFile = require('./isExtractableFile');\n","'use strict';\n\nvar ReactNativeFile = require('./ReactNativeFile');\n\nmodule.exports = function isExtractableFile(value) {\n return (\n (typeof File !== 'undefined' && value instanceof File) ||\n (typeof Blob !== 'undefined' && value instanceof Blob) ||\n value instanceof ReactNativeFile\n );\n};\n","/* eslint-env browser */\nmodule.exports = typeof self == 'object' ? self.FormData : window.FormData;\n",null,null,null,"'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.CopyToClipboard = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _copyToClipboard = _interopRequireDefault(require(\"copy-to-clipboard\"));\n\nvar _excluded = [\"text\", \"onCopy\", \"options\", \"children\"];\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar CopyToClipboard = /*#__PURE__*/function (_React$PureComponent) {\n _inherits(CopyToClipboard, _React$PureComponent);\n\n var _super = _createSuper(CopyToClipboard);\n\n function CopyToClipboard() {\n var _this;\n\n _classCallCheck(this, CopyToClipboard);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"onClick\", function (event) {\n var _this$props = _this.props,\n text = _this$props.text,\n onCopy = _this$props.onCopy,\n children = _this$props.children,\n options = _this$props.options;\n\n var elem = _react[\"default\"].Children.only(children);\n\n var result = (0, _copyToClipboard[\"default\"])(text, options);\n\n if (onCopy) {\n onCopy(text, result);\n } // Bypass onClick if it was present\n\n\n if (elem && elem.props && typeof elem.props.onClick === 'function') {\n elem.props.onClick(event);\n }\n });\n\n return _this;\n }\n\n _createClass(CopyToClipboard, [{\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n _text = _this$props2.text,\n _onCopy = _this$props2.onCopy,\n _options = _this$props2.options,\n children = _this$props2.children,\n props = _objectWithoutProperties(_this$props2, _excluded);\n\n var elem = _react[\"default\"].Children.only(children);\n\n return /*#__PURE__*/_react[\"default\"].cloneElement(elem, _objectSpread(_objectSpread({}, props), {}, {\n onClick: this.onClick\n }));\n }\n }]);\n\n return CopyToClipboard;\n}(_react[\"default\"].PureComponent);\n\nexports.CopyToClipboard = CopyToClipboard;\n\n_defineProperty(CopyToClipboard, \"defaultProps\", {\n onCopy: undefined,\n options: undefined\n});","\"use strict\";\n\nvar _require = require('./Component'),\n CopyToClipboard = _require.CopyToClipboard;\n\nCopyToClipboard.CopyToClipboard = CopyToClipboard;\nmodule.exports = CopyToClipboard;","/**\n * @license React\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';var aa=require(\"react\"),ca=require(\"scheduler\");function p(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cb}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){z[a]=new v(a,2,!1,a,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});[\"capture\",\"download\"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(ra,\nsa);z[b]=new v(b,1,!1,a,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});\nz.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k=\"\\n\"+e[g].replace(\" at new \",\" at \");a.displayName&&k.includes(\"\")&&(k=k.replace(\"\",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?Ma(a):\"\"}\nfunction Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma(\"Lazy\");case 13:return Ma(\"Suspense\");case 19:return Ma(\"SuspenseList\");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return\"\"}}\nfunction Qa(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case ya:return\"Fragment\";case wa:return\"Portal\";case Aa:return\"Profiler\";case za:return\"StrictMode\";case Ea:return\"Suspense\";case Fa:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||\"Context\")+\".Consumer\";case Ba:return(a._context.displayName||\"Context\")+\".Provider\";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName||\nb.name||\"\",a=\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||\"Memo\";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null}\nfunction Ra(a){var b=a.type;switch(a.tag){case 24:return\"Cache\";case 9:return(b.displayName||\"Context\")+\".Consumer\";case 10:return(b._context.displayName||\"Context\")+\".Provider\";case 18:return\"DehydratedFragment\";case 11:return a=b.render,a=a.displayName||a.name||\"\",b.displayName||(\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");case 7:return\"Fragment\";case 5:return b;case 4:return\"Portal\";case 3:return\"Root\";case 6:return\"Text\";case 16:return Qa(b);case 8:return b===za?\"StrictMode\":\"Mode\";case 22:return\"Offscreen\";\ncase 12:return\"Profiler\";case 21:return\"Scope\";case 13:return\"Suspense\";case 19:return\"SuspenseList\";case 25:return\"TracingMarker\";case 1:case 0:case 17:case 2:case 14:case 15:if(\"function\"===typeof b)return b.displayName||b.name||null;if(\"string\"===typeof b)return b}return null}function Sa(a){switch(typeof a){case \"boolean\":case \"number\":case \"string\":case \"undefined\":return a;case \"object\":return a;default:return\"\"}}\nfunction Ta(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction Ua(a){var b=Ta(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Ta(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,\"checked\",b,!1)}\nfunction bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?cb(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction db(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction cb(a,b,c){if(\"number\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}var eb=Array.isArray;\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e\"+b.valueOf().toString()+\"\";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,\nzoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(\"\"+b).trim():b+\"px\"}\nfunction sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=rb(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if(\"object\"!==typeof b.dangerouslySetInnerHTML||!(\"__html\"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(p(62));}}\nfunction vb(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}var wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\"function\"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;\nfunction tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;\ndefault:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}\nfunction Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \"keyup\":return-1!==$d.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"focusout\":return!0;default:return!1}}function he(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \"compositionend\":return he(b);case \"keypress\":if(32!==b.which)return null;fe=!0;return ee;case \"textInput\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return\"compositionend\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nfunction Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),\"selectionStart\"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c,\nd);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});\"function\"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\"selectionStart\"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,\"onSelect\"),0Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}\nfunction Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||\"Unknown\",e));return A({},c,d)}\nfunction cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)}\nfunction jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a>=g;e-=g;rg=1<<32-oc(b)+e|c<w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;ww?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e,\nm),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){\"object\"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if(\"object\"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k=\nf.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||\"object\"===typeof k&&null!==k&&k.$$typeof===Ha&&uh(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=sh(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Ah(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=yh(f.type,f.key,f.props,null,a.mode,h),h.ref=sh(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!==\nd;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=zh(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);th(a,f)}return\"string\"===typeof f&&\"\"!==f||\"number\"===typeof f?(f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):\n(c(a,d),d=xh(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Bh=vh(!0),Ch=vh(!1),Dh={},Eh=Uf(Dh),Fh=Uf(Dh),Gh=Uf(Dh);function Hh(a){if(a===Dh)throw Error(p(174));return a}function Ih(a,b){G(Gh,b);G(Fh,a);G(Eh,Dh);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:lb(null,\"\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=lb(b,a)}E(Eh);G(Eh,b)}function Jh(){E(Eh);E(Fh);E(Gh)}\nfunction Kh(a){Hh(Gh.current);var b=Hh(Eh.current);var c=lb(b,a.type);b!==c&&(G(Fh,a),G(Eh,c))}function Lh(a){Fh.current===a&&(E(Eh),E(Fh))}var M=Uf(0);\nfunction Mh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||\"$?\"===c.data||\"$!\"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&128))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var Nh=[];\nfunction Oh(){for(var a=0;ac?c:4;a(!0);var d=Qh.transition;Qh.transition={};try{a(!1),b()}finally{C=c,Qh.transition=d}}function Fi(){return di().memoizedState}\nfunction Gi(a,b,c){var d=lh(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,c);else if(c=Yg(a,b,c,d),null!==c){var e=L();mh(c,a,d,e);Ji(c,b,d)}}\nfunction ri(a,b,c){var d=lh(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hi(a))Ii(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,Xg(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=Yg(a,b,e,d);null!==c&&(e=L(),mh(c,a,d,e),Ji(c,b,d))}}\nfunction Hi(a){var b=a.alternate;return a===N||null!==b&&b===N}function Ii(a,b){Th=Sh=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Ji(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nvar ai={readContext:Vg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useInsertionEffect:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useDeferredValue:Q,useTransition:Q,useMutableSource:Q,useSyncExternalStore:Q,useId:Q,unstable_isNewReconciler:!1},Yh={readContext:Vg,useCallback:function(a,b){ci().memoizedState=[a,void 0===b?null:b];return a},useContext:Vg,useEffect:vi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ti(4194308,\n4,yi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ti(4194308,4,a,b)},useInsertionEffect:function(a,b){return ti(4,2,a,b)},useMemo:function(a,b){var c=ci();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=ci();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=Gi.bind(null,N,a);return[d.memoizedState,a]},useRef:function(a){var b=\nci();a={current:a};return b.memoizedState=a},useState:qi,useDebugValue:Ai,useDeferredValue:function(a){return ci().memoizedState=a},useTransition:function(){var a=qi(!1),b=a[0];a=Ei.bind(null,a[1]);ci().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=N,e=ci();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===R)throw Error(p(349));0!==(Rh&30)||ni(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;vi(ki.bind(null,d,\nf,a),[a]);d.flags|=2048;li(9,mi.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=ci(),b=R.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=\":\"+b+\"R\"+c;c=Uh++;0\\x3c/script>\",a=a.removeChild(a.firstChild)):\n\"string\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\"select\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;Aj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case \"dialog\":D(\"cancel\",a);D(\"close\",a);e=d;break;case \"iframe\":case \"object\":case \"embed\":D(\"load\",a);e=d;break;case \"video\":case \"audio\":for(e=0;eHj&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304)}else{if(!d)if(a=Mh(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Ej(f,!0),null===f.tail&&\"hidden\"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Hj&&1073741824!==c&&(b.flags|=128,d=!0,Ej(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=\nb,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=M.current,G(M,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Ij(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(gj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));}\nfunction Jj(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return Jh(),E(Wf),E(H),Oh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Lh(b),null;case 13:E(M);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(M),null;case 4:return Jh(),null;case 10:return Rg(b.type._context),null;case 22:case 23:return Ij(),\nnull;case 24:return null;default:return null}}var Kj=!1,U=!1,Lj=\"function\"===typeof WeakSet?WeakSet:Set,V=null;function Mj(a,b){var c=a.ref;if(null!==c)if(\"function\"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Nj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Oj=!1;\nfunction Pj(a,b){Cf=dd;a=Me();if(Ne(a)){if(\"selectionStart\"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+=\nq.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;\ncase 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Lg(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent=\"\":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Oj;Oj=!1;return n}\nfunction Qj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Nj(b,c,f)}e=e.next}while(e!==d)}}function Rj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Sj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}\"function\"===typeof b?b(a):b.current=a}}\nfunction Tj(a){var b=a.alternate;null!==b&&(a.alternate=null,Tj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Uj(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction Vj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Uj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}\nfunction Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling}\nfunction Xj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Xj(a,b,c),a=a.sibling;null!==a;)Xj(a,b,c),a=a.sibling}var X=null,Yj=!1;function Zj(a,b,c){for(c=c.child;null!==c;)ak(a,b,c),c=c.sibling}\nfunction ak(a,b,c){if(lc&&\"function\"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Mj(c,b);case 6:var d=X,e=Yj;X=null;Zj(a,b,c);X=d;Yj=e;null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Yj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Yj;X=c.stateNode.containerInfo;Yj=!0;\nZj(a,b,c);X=d;Yj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Nj(c,b,g):0!==(f&4)&&Nj(c,b,g));e=e.next}while(e!==d)}Zj(a,b,c);break;case 1:if(!U&&(Mj(c,b),d=c.stateNode,\"function\"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Zj(a,b,c);break;case 21:Zj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!==\nc.memoizedState,Zj(a,b,c),U=d):Zj(a,b,c);break;default:Zj(a,b,c)}}function bk(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Lj);b.forEach(function(b){var d=ck.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction dk(a,b){var c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*mk(d/1960))-d;if(10a?16:a;if(null===xk)var d=!1;else{a=xk;xk=null;yk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kB()-gk?Lk(a,0):sk|=c);Ek(a,b)}function Zk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=L();a=Zg(a,b);null!==a&&(Ac(a,b,c),Ek(a,c))}function vj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Zk(a,c)}\nfunction ck(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Zk(a,c)}var Wk;\nWk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)Ug=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return Ug=!1,zj(a,b,c);Ug=0!==(a.flags&131072)?!0:!1}else Ug=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;jj(a,b);a=b.pendingProps;var e=Yf(b,H.current);Tg(b,c);e=Xh(null,b,d,a,e,c);var f=bi();b.flags|=1;\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=\nnull,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,ah(b),e.updater=nh,b.stateNode=e,e._reactInternals=b,rh(b,d,a,c),b=kj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Yi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{jj(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=$k(d);a=Lg(d,a);switch(e){case 0:b=dj(null,b,d,a,c);break a;case 1:b=ij(null,b,d,a,c);break a;case 11:b=Zi(null,b,d,a,c);break a;case 14:b=aj(null,b,d,Lg(d.type,a),c);break a}throw Error(p(306,\nd,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),dj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),ij(a,b,d,e,c);case 3:a:{lj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;bh(a,b);gh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=\nf,b.memoizedState=f,b.flags&256){e=Ki(Error(p(423)),b);b=mj(a,b,d,c,e);break a}else if(d!==e){e=Ki(Error(p(424)),b);b=mj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Ch(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=$i(a,b,c);break a}Yi(a,b,d,c)}b=b.child}return b;case 5:return Kh(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32),\nhj(a,b),Yi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return pj(a,b,c);case 4:return Ih(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Bh(b,null,d,c):Yi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),Zi(a,b,d,e,c);case 7:return Yi(a,b,b.pendingProps,c),b.child;case 8:return Yi(a,b,b.pendingProps.children,c),b.child;case 12:return Yi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;\ng=e.value;G(Mg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=$i(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=ch(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);Sg(f.return,\nc,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);Sg(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Yi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,Tg(b,c),e=Vg(e),d=d(e),b.flags|=1,Yi(a,b,d,c),\nb.child;case 14:return d=b.type,e=Lg(d,b.pendingProps),e=Lg(d.type,e),aj(a,b,d,e,c);case 15:return cj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Lg(d,e),jj(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,Tg(b,c),ph(b,d,e),rh(b,d,e,c),kj(null,b,d,!0,a,c);case 19:return yj(a,b,c);case 22:return ej(a,b,c)}throw Error(p(156,b.tag));};function Gk(a,b){return ac(a,b)}\nfunction al(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new al(a,b,c,d)}function bj(a){a=a.prototype;return!(!a||!a.isReactComponent)}\nfunction $k(a){if(\"function\"===typeof a)return bj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2}\nfunction wh(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction yh(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)bj(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case ya:return Ah(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return qj(c,e,f,b);default:if(\"object\"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11;\nbreak a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,\"\"));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Ah(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function qj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function xh(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a}\nfunction zh(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction bl(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=\nnull}function cl(a,b,c,d,e,f,g,h,k){a=new bl(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};ah(f);return a}function dl(a,b,c){var d=3 0 ? this.queries.filter(function (query) {\n return matchQuery(filters, query);\n }) : this.queries;\n };\n\n _proto.notify = function notify(event) {\n var _this3 = this;\n\n notifyManager.batch(function () {\n _this3.listeners.forEach(function (listener) {\n listener(event);\n });\n });\n };\n\n _proto.onFocus = function onFocus() {\n var _this4 = this;\n\n notifyManager.batch(function () {\n _this4.queries.forEach(function (query) {\n query.onFocus();\n });\n });\n };\n\n _proto.onOnline = function onOnline() {\n var _this5 = this;\n\n notifyManager.batch(function () {\n _this5.queries.forEach(function (query) {\n query.onOnline();\n });\n });\n };\n\n return QueryCache;\n}(Subscribable);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { getLogger } from './logger';\nimport { notifyManager } from './notifyManager';\nimport { Retryer } from './retryer';\nimport { noop } from './utils'; // TYPES\n\n// CLASS\nexport var Mutation = /*#__PURE__*/function () {\n function Mutation(config) {\n this.options = _extends({}, config.defaultOptions, config.options);\n this.mutationId = config.mutationId;\n this.mutationCache = config.mutationCache;\n this.observers = [];\n this.state = config.state || getDefaultState();\n this.meta = config.meta;\n }\n\n var _proto = Mutation.prototype;\n\n _proto.setState = function setState(state) {\n this.dispatch({\n type: 'setState',\n state: state\n });\n };\n\n _proto.addObserver = function addObserver(observer) {\n if (this.observers.indexOf(observer) === -1) {\n this.observers.push(observer);\n }\n };\n\n _proto.removeObserver = function removeObserver(observer) {\n this.observers = this.observers.filter(function (x) {\n return x !== observer;\n });\n };\n\n _proto.cancel = function cancel() {\n if (this.retryer) {\n this.retryer.cancel();\n return this.retryer.promise.then(noop).catch(noop);\n }\n\n return Promise.resolve();\n };\n\n _proto.continue = function _continue() {\n if (this.retryer) {\n this.retryer.continue();\n return this.retryer.promise;\n }\n\n return this.execute();\n };\n\n _proto.execute = function execute() {\n var _this = this;\n\n var data;\n var restored = this.state.status === 'loading';\n var promise = Promise.resolve();\n\n if (!restored) {\n this.dispatch({\n type: 'loading',\n variables: this.options.variables\n });\n promise = promise.then(function () {\n // Notify cache callback\n _this.mutationCache.config.onMutate == null ? void 0 : _this.mutationCache.config.onMutate(_this.state.variables, _this);\n }).then(function () {\n return _this.options.onMutate == null ? void 0 : _this.options.onMutate(_this.state.variables);\n }).then(function (context) {\n if (context !== _this.state.context) {\n _this.dispatch({\n type: 'loading',\n context: context,\n variables: _this.state.variables\n });\n }\n });\n }\n\n return promise.then(function () {\n return _this.executeMutation();\n }).then(function (result) {\n data = result; // Notify cache callback\n\n _this.mutationCache.config.onSuccess == null ? void 0 : _this.mutationCache.config.onSuccess(data, _this.state.variables, _this.state.context, _this);\n }).then(function () {\n return _this.options.onSuccess == null ? void 0 : _this.options.onSuccess(data, _this.state.variables, _this.state.context);\n }).then(function () {\n return _this.options.onSettled == null ? void 0 : _this.options.onSettled(data, null, _this.state.variables, _this.state.context);\n }).then(function () {\n _this.dispatch({\n type: 'success',\n data: data\n });\n\n return data;\n }).catch(function (error) {\n // Notify cache callback\n _this.mutationCache.config.onError == null ? void 0 : _this.mutationCache.config.onError(error, _this.state.variables, _this.state.context, _this); // Log error\n\n getLogger().error(error);\n return Promise.resolve().then(function () {\n return _this.options.onError == null ? void 0 : _this.options.onError(error, _this.state.variables, _this.state.context);\n }).then(function () {\n return _this.options.onSettled == null ? void 0 : _this.options.onSettled(undefined, error, _this.state.variables, _this.state.context);\n }).then(function () {\n _this.dispatch({\n type: 'error',\n error: error\n });\n\n throw error;\n });\n });\n };\n\n _proto.executeMutation = function executeMutation() {\n var _this2 = this,\n _this$options$retry;\n\n this.retryer = new Retryer({\n fn: function fn() {\n if (!_this2.options.mutationFn) {\n return Promise.reject('No mutationFn found');\n }\n\n return _this2.options.mutationFn(_this2.state.variables);\n },\n onFail: function onFail() {\n _this2.dispatch({\n type: 'failed'\n });\n },\n onPause: function onPause() {\n _this2.dispatch({\n type: 'pause'\n });\n },\n onContinue: function onContinue() {\n _this2.dispatch({\n type: 'continue'\n });\n },\n retry: (_this$options$retry = this.options.retry) != null ? _this$options$retry : 0,\n retryDelay: this.options.retryDelay\n });\n return this.retryer.promise;\n };\n\n _proto.dispatch = function dispatch(action) {\n var _this3 = this;\n\n this.state = reducer(this.state, action);\n notifyManager.batch(function () {\n _this3.observers.forEach(function (observer) {\n observer.onMutationUpdate(action);\n });\n\n _this3.mutationCache.notify(_this3);\n });\n };\n\n return Mutation;\n}();\nexport function getDefaultState() {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n isPaused: false,\n status: 'idle',\n variables: undefined\n };\n}\n\nfunction reducer(state, action) {\n switch (action.type) {\n case 'failed':\n return _extends({}, state, {\n failureCount: state.failureCount + 1\n });\n\n case 'pause':\n return _extends({}, state, {\n isPaused: true\n });\n\n case 'continue':\n return _extends({}, state, {\n isPaused: false\n });\n\n case 'loading':\n return _extends({}, state, {\n context: action.context,\n data: undefined,\n error: null,\n isPaused: false,\n status: 'loading',\n variables: action.variables\n });\n\n case 'success':\n return _extends({}, state, {\n data: action.data,\n error: null,\n status: 'success',\n isPaused: false\n });\n\n case 'error':\n return _extends({}, state, {\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n isPaused: false,\n status: 'error'\n });\n\n case 'setState':\n return _extends({}, state, action.state);\n\n default:\n return state;\n }\n}","import _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport { notifyManager } from './notifyManager';\nimport { Mutation } from './mutation';\nimport { matchMutation, noop } from './utils';\nimport { Subscribable } from './subscribable'; // TYPES\n\n// CLASS\nexport var MutationCache = /*#__PURE__*/function (_Subscribable) {\n _inheritsLoose(MutationCache, _Subscribable);\n\n function MutationCache(config) {\n var _this;\n\n _this = _Subscribable.call(this) || this;\n _this.config = config || {};\n _this.mutations = [];\n _this.mutationId = 0;\n return _this;\n }\n\n var _proto = MutationCache.prototype;\n\n _proto.build = function build(client, options, state) {\n var mutation = new Mutation({\n mutationCache: this,\n mutationId: ++this.mutationId,\n options: client.defaultMutationOptions(options),\n state: state,\n defaultOptions: options.mutationKey ? client.getMutationDefaults(options.mutationKey) : undefined,\n meta: options.meta\n });\n this.add(mutation);\n return mutation;\n };\n\n _proto.add = function add(mutation) {\n this.mutations.push(mutation);\n this.notify(mutation);\n };\n\n _proto.remove = function remove(mutation) {\n this.mutations = this.mutations.filter(function (x) {\n return x !== mutation;\n });\n mutation.cancel();\n this.notify(mutation);\n };\n\n _proto.clear = function clear() {\n var _this2 = this;\n\n notifyManager.batch(function () {\n _this2.mutations.forEach(function (mutation) {\n _this2.remove(mutation);\n });\n });\n };\n\n _proto.getAll = function getAll() {\n return this.mutations;\n };\n\n _proto.find = function find(filters) {\n if (typeof filters.exact === 'undefined') {\n filters.exact = true;\n }\n\n return this.mutations.find(function (mutation) {\n return matchMutation(filters, mutation);\n });\n };\n\n _proto.findAll = function findAll(filters) {\n return this.mutations.filter(function (mutation) {\n return matchMutation(filters, mutation);\n });\n };\n\n _proto.notify = function notify(mutation) {\n var _this3 = this;\n\n notifyManager.batch(function () {\n _this3.listeners.forEach(function (listener) {\n listener(mutation);\n });\n });\n };\n\n _proto.onFocus = function onFocus() {\n this.resumePausedMutations();\n };\n\n _proto.onOnline = function onOnline() {\n this.resumePausedMutations();\n };\n\n _proto.resumePausedMutations = function resumePausedMutations() {\n var pausedMutations = this.mutations.filter(function (x) {\n return x.state.isPaused;\n });\n return notifyManager.batch(function () {\n return pausedMutations.reduce(function (promise, mutation) {\n return promise.then(function () {\n return mutation.continue().catch(noop);\n });\n }, Promise.resolve());\n });\n };\n\n return MutationCache;\n}(Subscribable);","import { isCancelable } from './retryer';\nimport { getAbortController } from './utils';\nexport function infiniteQueryBehavior() {\n return {\n onFetch: function onFetch(context) {\n context.fetchFn = function () {\n var _context$fetchOptions, _context$fetchOptions2, _context$fetchOptions3, _context$fetchOptions4, _context$state$data, _context$state$data2;\n\n var refetchPage = (_context$fetchOptions = context.fetchOptions) == null ? void 0 : (_context$fetchOptions2 = _context$fetchOptions.meta) == null ? void 0 : _context$fetchOptions2.refetchPage;\n var fetchMore = (_context$fetchOptions3 = context.fetchOptions) == null ? void 0 : (_context$fetchOptions4 = _context$fetchOptions3.meta) == null ? void 0 : _context$fetchOptions4.fetchMore;\n var pageParam = fetchMore == null ? void 0 : fetchMore.pageParam;\n var isFetchingNextPage = (fetchMore == null ? void 0 : fetchMore.direction) === 'forward';\n var isFetchingPreviousPage = (fetchMore == null ? void 0 : fetchMore.direction) === 'backward';\n var oldPages = ((_context$state$data = context.state.data) == null ? void 0 : _context$state$data.pages) || [];\n var oldPageParams = ((_context$state$data2 = context.state.data) == null ? void 0 : _context$state$data2.pageParams) || [];\n var abortController = getAbortController();\n var abortSignal = abortController == null ? void 0 : abortController.signal;\n var newPageParams = oldPageParams;\n var cancelled = false; // Get query function\n\n var queryFn = context.options.queryFn || function () {\n return Promise.reject('Missing queryFn');\n };\n\n var buildNewPages = function buildNewPages(pages, param, page, previous) {\n newPageParams = previous ? [param].concat(newPageParams) : [].concat(newPageParams, [param]);\n return previous ? [page].concat(pages) : [].concat(pages, [page]);\n }; // Create function to fetch a page\n\n\n var fetchPage = function fetchPage(pages, manual, param, previous) {\n if (cancelled) {\n return Promise.reject('Cancelled');\n }\n\n if (typeof param === 'undefined' && !manual && pages.length) {\n return Promise.resolve(pages);\n }\n\n var queryFnContext = {\n queryKey: context.queryKey,\n signal: abortSignal,\n pageParam: param,\n meta: context.meta\n };\n var queryFnResult = queryFn(queryFnContext);\n var promise = Promise.resolve(queryFnResult).then(function (page) {\n return buildNewPages(pages, param, page, previous);\n });\n\n if (isCancelable(queryFnResult)) {\n var promiseAsAny = promise;\n promiseAsAny.cancel = queryFnResult.cancel;\n }\n\n return promise;\n };\n\n var promise; // Fetch first page?\n\n if (!oldPages.length) {\n promise = fetchPage([]);\n } // Fetch next page?\n else if (isFetchingNextPage) {\n var manual = typeof pageParam !== 'undefined';\n var param = manual ? pageParam : getNextPageParam(context.options, oldPages);\n promise = fetchPage(oldPages, manual, param);\n } // Fetch previous page?\n else if (isFetchingPreviousPage) {\n var _manual = typeof pageParam !== 'undefined';\n\n var _param = _manual ? pageParam : getPreviousPageParam(context.options, oldPages);\n\n promise = fetchPage(oldPages, _manual, _param, true);\n } // Refetch pages\n else {\n (function () {\n newPageParams = [];\n var manual = typeof context.options.getNextPageParam === 'undefined';\n var shouldFetchFirstPage = refetchPage && oldPages[0] ? refetchPage(oldPages[0], 0, oldPages) : true; // Fetch first page\n\n promise = shouldFetchFirstPage ? fetchPage([], manual, oldPageParams[0]) : Promise.resolve(buildNewPages([], oldPageParams[0], oldPages[0])); // Fetch remaining pages\n\n var _loop = function _loop(i) {\n promise = promise.then(function (pages) {\n var shouldFetchNextPage = refetchPage && oldPages[i] ? refetchPage(oldPages[i], i, oldPages) : true;\n\n if (shouldFetchNextPage) {\n var _param2 = manual ? oldPageParams[i] : getNextPageParam(context.options, pages);\n\n return fetchPage(pages, manual, _param2);\n }\n\n return Promise.resolve(buildNewPages(pages, oldPageParams[i], oldPages[i]));\n });\n };\n\n for (var i = 1; i < oldPages.length; i++) {\n _loop(i);\n }\n })();\n }\n\n var finalPromise = promise.then(function (pages) {\n return {\n pages: pages,\n pageParams: newPageParams\n };\n });\n var finalPromiseAsAny = finalPromise;\n\n finalPromiseAsAny.cancel = function () {\n cancelled = true;\n abortController == null ? void 0 : abortController.abort();\n\n if (isCancelable(promise)) {\n promise.cancel();\n }\n };\n\n return finalPromise;\n };\n }\n };\n}\nexport function getNextPageParam(options, pages) {\n return options.getNextPageParam == null ? void 0 : options.getNextPageParam(pages[pages.length - 1], pages);\n}\nexport function getPreviousPageParam(options, pages) {\n return options.getPreviousPageParam == null ? void 0 : options.getPreviousPageParam(pages[0], pages);\n}\n/**\n * Checks if there is a next page.\n * Returns `undefined` if it cannot be determined.\n */\n\nexport function hasNextPage(options, pages) {\n if (options.getNextPageParam && Array.isArray(pages)) {\n var nextPageParam = getNextPageParam(options, pages);\n return typeof nextPageParam !== 'undefined' && nextPageParam !== null && nextPageParam !== false;\n }\n}\n/**\n * Checks if there is a previous page.\n * Returns `undefined` if it cannot be determined.\n */\n\nexport function hasPreviousPage(options, pages) {\n if (options.getPreviousPageParam && Array.isArray(pages)) {\n var previousPageParam = getPreviousPageParam(options, pages);\n return typeof previousPageParam !== 'undefined' && previousPageParam !== null && previousPageParam !== false;\n }\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { hashQueryKey, noop, parseFilterArgs, parseQueryArgs, partialMatchKey, hashQueryKeyByOptions } from './utils';\nimport { QueryCache } from './queryCache';\nimport { MutationCache } from './mutationCache';\nimport { focusManager } from './focusManager';\nimport { onlineManager } from './onlineManager';\nimport { notifyManager } from './notifyManager';\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior';\n// CLASS\nexport var QueryClient = /*#__PURE__*/function () {\n function QueryClient(config) {\n if (config === void 0) {\n config = {};\n }\n\n this.queryCache = config.queryCache || new QueryCache();\n this.mutationCache = config.mutationCache || new MutationCache();\n this.defaultOptions = config.defaultOptions || {};\n this.queryDefaults = [];\n this.mutationDefaults = [];\n }\n\n var _proto = QueryClient.prototype;\n\n _proto.mount = function mount() {\n var _this = this;\n\n this.unsubscribeFocus = focusManager.subscribe(function () {\n if (focusManager.isFocused() && onlineManager.isOnline()) {\n _this.mutationCache.onFocus();\n\n _this.queryCache.onFocus();\n }\n });\n this.unsubscribeOnline = onlineManager.subscribe(function () {\n if (focusManager.isFocused() && onlineManager.isOnline()) {\n _this.mutationCache.onOnline();\n\n _this.queryCache.onOnline();\n }\n });\n };\n\n _proto.unmount = function unmount() {\n var _this$unsubscribeFocu, _this$unsubscribeOnli;\n\n (_this$unsubscribeFocu = this.unsubscribeFocus) == null ? void 0 : _this$unsubscribeFocu.call(this);\n (_this$unsubscribeOnli = this.unsubscribeOnline) == null ? void 0 : _this$unsubscribeOnli.call(this);\n };\n\n _proto.isFetching = function isFetching(arg1, arg2) {\n var _parseFilterArgs = parseFilterArgs(arg1, arg2),\n filters = _parseFilterArgs[0];\n\n filters.fetching = true;\n return this.queryCache.findAll(filters).length;\n };\n\n _proto.isMutating = function isMutating(filters) {\n return this.mutationCache.findAll(_extends({}, filters, {\n fetching: true\n })).length;\n };\n\n _proto.getQueryData = function getQueryData(queryKey, filters) {\n var _this$queryCache$find;\n\n return (_this$queryCache$find = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find.state.data;\n };\n\n _proto.getQueriesData = function getQueriesData(queryKeyOrFilters) {\n return this.getQueryCache().findAll(queryKeyOrFilters).map(function (_ref) {\n var queryKey = _ref.queryKey,\n state = _ref.state;\n var data = state.data;\n return [queryKey, data];\n });\n };\n\n _proto.setQueryData = function setQueryData(queryKey, updater, options) {\n var parsedOptions = parseQueryArgs(queryKey);\n var defaultedOptions = this.defaultQueryOptions(parsedOptions);\n return this.queryCache.build(this, defaultedOptions).setData(updater, options);\n };\n\n _proto.setQueriesData = function setQueriesData(queryKeyOrFilters, updater, options) {\n var _this2 = this;\n\n return notifyManager.batch(function () {\n return _this2.getQueryCache().findAll(queryKeyOrFilters).map(function (_ref2) {\n var queryKey = _ref2.queryKey;\n return [queryKey, _this2.setQueryData(queryKey, updater, options)];\n });\n });\n };\n\n _proto.getQueryState = function getQueryState(queryKey, filters) {\n var _this$queryCache$find2;\n\n return (_this$queryCache$find2 = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find2.state;\n };\n\n _proto.removeQueries = function removeQueries(arg1, arg2) {\n var _parseFilterArgs2 = parseFilterArgs(arg1, arg2),\n filters = _parseFilterArgs2[0];\n\n var queryCache = this.queryCache;\n notifyManager.batch(function () {\n queryCache.findAll(filters).forEach(function (query) {\n queryCache.remove(query);\n });\n });\n };\n\n _proto.resetQueries = function resetQueries(arg1, arg2, arg3) {\n var _this3 = this;\n\n var _parseFilterArgs3 = parseFilterArgs(arg1, arg2, arg3),\n filters = _parseFilterArgs3[0],\n options = _parseFilterArgs3[1];\n\n var queryCache = this.queryCache;\n\n var refetchFilters = _extends({}, filters, {\n active: true\n });\n\n return notifyManager.batch(function () {\n queryCache.findAll(filters).forEach(function (query) {\n query.reset();\n });\n return _this3.refetchQueries(refetchFilters, options);\n });\n };\n\n _proto.cancelQueries = function cancelQueries(arg1, arg2, arg3) {\n var _this4 = this;\n\n var _parseFilterArgs4 = parseFilterArgs(arg1, arg2, arg3),\n filters = _parseFilterArgs4[0],\n _parseFilterArgs4$ = _parseFilterArgs4[1],\n cancelOptions = _parseFilterArgs4$ === void 0 ? {} : _parseFilterArgs4$;\n\n if (typeof cancelOptions.revert === 'undefined') {\n cancelOptions.revert = true;\n }\n\n var promises = notifyManager.batch(function () {\n return _this4.queryCache.findAll(filters).map(function (query) {\n return query.cancel(cancelOptions);\n });\n });\n return Promise.all(promises).then(noop).catch(noop);\n };\n\n _proto.invalidateQueries = function invalidateQueries(arg1, arg2, arg3) {\n var _ref3,\n _filters$refetchActiv,\n _filters$refetchInact,\n _this5 = this;\n\n var _parseFilterArgs5 = parseFilterArgs(arg1, arg2, arg3),\n filters = _parseFilterArgs5[0],\n options = _parseFilterArgs5[1];\n\n var refetchFilters = _extends({}, filters, {\n // if filters.refetchActive is not provided and filters.active is explicitly false,\n // e.g. invalidateQueries({ active: false }), we don't want to refetch active queries\n active: (_ref3 = (_filters$refetchActiv = filters.refetchActive) != null ? _filters$refetchActiv : filters.active) != null ? _ref3 : true,\n inactive: (_filters$refetchInact = filters.refetchInactive) != null ? _filters$refetchInact : false\n });\n\n return notifyManager.batch(function () {\n _this5.queryCache.findAll(filters).forEach(function (query) {\n query.invalidate();\n });\n\n return _this5.refetchQueries(refetchFilters, options);\n });\n };\n\n _proto.refetchQueries = function refetchQueries(arg1, arg2, arg3) {\n var _this6 = this;\n\n var _parseFilterArgs6 = parseFilterArgs(arg1, arg2, arg3),\n filters = _parseFilterArgs6[0],\n options = _parseFilterArgs6[1];\n\n var promises = notifyManager.batch(function () {\n return _this6.queryCache.findAll(filters).map(function (query) {\n return query.fetch(undefined, _extends({}, options, {\n meta: {\n refetchPage: filters == null ? void 0 : filters.refetchPage\n }\n }));\n });\n });\n var promise = Promise.all(promises).then(noop);\n\n if (!(options == null ? void 0 : options.throwOnError)) {\n promise = promise.catch(noop);\n }\n\n return promise;\n };\n\n _proto.fetchQuery = function fetchQuery(arg1, arg2, arg3) {\n var parsedOptions = parseQueryArgs(arg1, arg2, arg3);\n var defaultedOptions = this.defaultQueryOptions(parsedOptions); // https://github.com/tannerlinsley/react-query/issues/652\n\n if (typeof defaultedOptions.retry === 'undefined') {\n defaultedOptions.retry = false;\n }\n\n var query = this.queryCache.build(this, defaultedOptions);\n return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);\n };\n\n _proto.prefetchQuery = function prefetchQuery(arg1, arg2, arg3) {\n return this.fetchQuery(arg1, arg2, arg3).then(noop).catch(noop);\n };\n\n _proto.fetchInfiniteQuery = function fetchInfiniteQuery(arg1, arg2, arg3) {\n var parsedOptions = parseQueryArgs(arg1, arg2, arg3);\n parsedOptions.behavior = infiniteQueryBehavior();\n return this.fetchQuery(parsedOptions);\n };\n\n _proto.prefetchInfiniteQuery = function prefetchInfiniteQuery(arg1, arg2, arg3) {\n return this.fetchInfiniteQuery(arg1, arg2, arg3).then(noop).catch(noop);\n };\n\n _proto.cancelMutations = function cancelMutations() {\n var _this7 = this;\n\n var promises = notifyManager.batch(function () {\n return _this7.mutationCache.getAll().map(function (mutation) {\n return mutation.cancel();\n });\n });\n return Promise.all(promises).then(noop).catch(noop);\n };\n\n _proto.resumePausedMutations = function resumePausedMutations() {\n return this.getMutationCache().resumePausedMutations();\n };\n\n _proto.executeMutation = function executeMutation(options) {\n return this.mutationCache.build(this, options).execute();\n };\n\n _proto.getQueryCache = function getQueryCache() {\n return this.queryCache;\n };\n\n _proto.getMutationCache = function getMutationCache() {\n return this.mutationCache;\n };\n\n _proto.getDefaultOptions = function getDefaultOptions() {\n return this.defaultOptions;\n };\n\n _proto.setDefaultOptions = function setDefaultOptions(options) {\n this.defaultOptions = options;\n };\n\n _proto.setQueryDefaults = function setQueryDefaults(queryKey, options) {\n var result = this.queryDefaults.find(function (x) {\n return hashQueryKey(queryKey) === hashQueryKey(x.queryKey);\n });\n\n if (result) {\n result.defaultOptions = options;\n } else {\n this.queryDefaults.push({\n queryKey: queryKey,\n defaultOptions: options\n });\n }\n };\n\n _proto.getQueryDefaults = function getQueryDefaults(queryKey) {\n var _this$queryDefaults$f;\n\n return queryKey ? (_this$queryDefaults$f = this.queryDefaults.find(function (x) {\n return partialMatchKey(queryKey, x.queryKey);\n })) == null ? void 0 : _this$queryDefaults$f.defaultOptions : undefined;\n };\n\n _proto.setMutationDefaults = function setMutationDefaults(mutationKey, options) {\n var result = this.mutationDefaults.find(function (x) {\n return hashQueryKey(mutationKey) === hashQueryKey(x.mutationKey);\n });\n\n if (result) {\n result.defaultOptions = options;\n } else {\n this.mutationDefaults.push({\n mutationKey: mutationKey,\n defaultOptions: options\n });\n }\n };\n\n _proto.getMutationDefaults = function getMutationDefaults(mutationKey) {\n var _this$mutationDefault;\n\n return mutationKey ? (_this$mutationDefault = this.mutationDefaults.find(function (x) {\n return partialMatchKey(mutationKey, x.mutationKey);\n })) == null ? void 0 : _this$mutationDefault.defaultOptions : undefined;\n };\n\n _proto.defaultQueryOptions = function defaultQueryOptions(options) {\n if (options == null ? void 0 : options._defaulted) {\n return options;\n }\n\n var defaultedOptions = _extends({}, this.defaultOptions.queries, this.getQueryDefaults(options == null ? void 0 : options.queryKey), options, {\n _defaulted: true\n });\n\n if (!defaultedOptions.queryHash && defaultedOptions.queryKey) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(defaultedOptions.queryKey, defaultedOptions);\n }\n\n return defaultedOptions;\n };\n\n _proto.defaultQueryObserverOptions = function defaultQueryObserverOptions(options) {\n return this.defaultQueryOptions(options);\n };\n\n _proto.defaultMutationOptions = function defaultMutationOptions(options) {\n if (options == null ? void 0 : options._defaulted) {\n return options;\n }\n\n return _extends({}, this.defaultOptions.mutations, this.getMutationDefaults(options == null ? void 0 : options.mutationKey), options, {\n _defaulted: true\n });\n };\n\n _proto.clear = function clear() {\n this.queryCache.clear();\n this.mutationCache.clear();\n };\n\n return QueryClient;\n}();","import { focusManager } from './focusManager';\nimport { onlineManager } from './onlineManager';\nimport { sleep } from './utils';\n\nfunction defaultRetryDelay(failureCount) {\n return Math.min(1000 * Math.pow(2, failureCount), 30000);\n}\n\nexport function isCancelable(value) {\n return typeof (value == null ? void 0 : value.cancel) === 'function';\n}\nexport var CancelledError = function CancelledError(options) {\n this.revert = options == null ? void 0 : options.revert;\n this.silent = options == null ? void 0 : options.silent;\n};\nexport function isCancelledError(value) {\n return value instanceof CancelledError;\n} // CLASS\n\nexport var Retryer = function Retryer(config) {\n var _this = this;\n\n var cancelRetry = false;\n var cancelFn;\n var continueFn;\n var promiseResolve;\n var promiseReject;\n this.abort = config.abort;\n\n this.cancel = function (cancelOptions) {\n return cancelFn == null ? void 0 : cancelFn(cancelOptions);\n };\n\n this.cancelRetry = function () {\n cancelRetry = true;\n };\n\n this.continueRetry = function () {\n cancelRetry = false;\n };\n\n this.continue = function () {\n return continueFn == null ? void 0 : continueFn();\n };\n\n this.failureCount = 0;\n this.isPaused = false;\n this.isResolved = false;\n this.isTransportCancelable = false;\n this.promise = new Promise(function (outerResolve, outerReject) {\n promiseResolve = outerResolve;\n promiseReject = outerReject;\n });\n\n var resolve = function resolve(value) {\n if (!_this.isResolved) {\n _this.isResolved = true;\n config.onSuccess == null ? void 0 : config.onSuccess(value);\n continueFn == null ? void 0 : continueFn();\n promiseResolve(value);\n }\n };\n\n var reject = function reject(value) {\n if (!_this.isResolved) {\n _this.isResolved = true;\n config.onError == null ? void 0 : config.onError(value);\n continueFn == null ? void 0 : continueFn();\n promiseReject(value);\n }\n };\n\n var pause = function pause() {\n return new Promise(function (continueResolve) {\n continueFn = continueResolve;\n _this.isPaused = true;\n config.onPause == null ? void 0 : config.onPause();\n }).then(function () {\n continueFn = undefined;\n _this.isPaused = false;\n config.onContinue == null ? void 0 : config.onContinue();\n });\n }; // Create loop function\n\n\n var run = function run() {\n // Do nothing if already resolved\n if (_this.isResolved) {\n return;\n }\n\n var promiseOrValue; // Execute query\n\n try {\n promiseOrValue = config.fn();\n } catch (error) {\n promiseOrValue = Promise.reject(error);\n } // Create callback to cancel this fetch\n\n\n cancelFn = function cancelFn(cancelOptions) {\n if (!_this.isResolved) {\n reject(new CancelledError(cancelOptions));\n _this.abort == null ? void 0 : _this.abort(); // Cancel transport if supported\n\n if (isCancelable(promiseOrValue)) {\n try {\n promiseOrValue.cancel();\n } catch (_unused) {}\n }\n }\n }; // Check if the transport layer support cancellation\n\n\n _this.isTransportCancelable = isCancelable(promiseOrValue);\n Promise.resolve(promiseOrValue).then(resolve).catch(function (error) {\n var _config$retry, _config$retryDelay;\n\n // Stop if the fetch is already resolved\n if (_this.isResolved) {\n return;\n } // Do we need to retry the request?\n\n\n var retry = (_config$retry = config.retry) != null ? _config$retry : 3;\n var retryDelay = (_config$retryDelay = config.retryDelay) != null ? _config$retryDelay : defaultRetryDelay;\n var delay = typeof retryDelay === 'function' ? retryDelay(_this.failureCount, error) : retryDelay;\n var shouldRetry = retry === true || typeof retry === 'number' && _this.failureCount < retry || typeof retry === 'function' && retry(_this.failureCount, error);\n\n if (cancelRetry || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error);\n return;\n }\n\n _this.failureCount++; // Notify on fail\n\n config.onFail == null ? void 0 : config.onFail(_this.failureCount, error); // Delay\n\n sleep(delay) // Pause if the document is not visible or when the device is offline\n .then(function () {\n if (!focusManager.isFocused() || !onlineManager.isOnline()) {\n return pause();\n }\n }).then(function () {\n if (cancelRetry) {\n reject(error);\n } else {\n run();\n }\n });\n });\n }; // Start loop\n\n\n run();\n};","export var Subscribable = /*#__PURE__*/function () {\n function Subscribable() {\n this.listeners = [];\n }\n\n var _proto = Subscribable.prototype;\n\n _proto.subscribe = function subscribe(listener) {\n var _this = this;\n\n var callback = listener || function () {\n return undefined;\n };\n\n this.listeners.push(callback);\n this.onSubscribe();\n return function () {\n _this.listeners = _this.listeners.filter(function (x) {\n return x !== callback;\n });\n\n _this.onUnsubscribe();\n };\n };\n\n _proto.hasListeners = function hasListeners() {\n return this.listeners.length > 0;\n };\n\n _proto.onSubscribe = function onSubscribe() {// Do nothing\n };\n\n _proto.onUnsubscribe = function onUnsubscribe() {// Do nothing\n };\n\n return Subscribable;\n}();","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// TYPES\n// UTILS\nexport var isServer = typeof window === 'undefined';\nexport function noop() {\n return undefined;\n}\nexport function functionalUpdate(updater, input) {\n return typeof updater === 'function' ? updater(input) : updater;\n}\nexport function isValidTimeout(value) {\n return typeof value === 'number' && value >= 0 && value !== Infinity;\n}\nexport function ensureQueryKeyArray(value) {\n return Array.isArray(value) ? value : [value];\n}\nexport function difference(array1, array2) {\n return array1.filter(function (x) {\n return array2.indexOf(x) === -1;\n });\n}\nexport function replaceAt(array, index, value) {\n var copy = array.slice(0);\n copy[index] = value;\n return copy;\n}\nexport function timeUntilStale(updatedAt, staleTime) {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\nexport function parseQueryArgs(arg1, arg2, arg3) {\n if (!isQueryKey(arg1)) {\n return arg1;\n }\n\n if (typeof arg2 === 'function') {\n return _extends({}, arg3, {\n queryKey: arg1,\n queryFn: arg2\n });\n }\n\n return _extends({}, arg2, {\n queryKey: arg1\n });\n}\nexport function parseMutationArgs(arg1, arg2, arg3) {\n if (isQueryKey(arg1)) {\n if (typeof arg2 === 'function') {\n return _extends({}, arg3, {\n mutationKey: arg1,\n mutationFn: arg2\n });\n }\n\n return _extends({}, arg2, {\n mutationKey: arg1\n });\n }\n\n if (typeof arg1 === 'function') {\n return _extends({}, arg2, {\n mutationFn: arg1\n });\n }\n\n return _extends({}, arg1);\n}\nexport function parseFilterArgs(arg1, arg2, arg3) {\n return isQueryKey(arg1) ? [_extends({}, arg2, {\n queryKey: arg1\n }), arg3] : [arg1 || {}, arg2];\n}\nexport function parseMutationFilterArgs(arg1, arg2) {\n return isQueryKey(arg1) ? _extends({}, arg2, {\n mutationKey: arg1\n }) : arg1;\n}\nexport function mapQueryStatusFilter(active, inactive) {\n if (active === true && inactive === true || active == null && inactive == null) {\n return 'all';\n } else if (active === false && inactive === false) {\n return 'none';\n } else {\n // At this point, active|inactive can only be true|false or false|true\n // so, when only one value is provided, the missing one has to be the negated value\n var isActive = active != null ? active : !inactive;\n return isActive ? 'active' : 'inactive';\n }\n}\nexport function matchQuery(filters, query) {\n var active = filters.active,\n exact = filters.exact,\n fetching = filters.fetching,\n inactive = filters.inactive,\n predicate = filters.predicate,\n queryKey = filters.queryKey,\n stale = filters.stale;\n\n if (isQueryKey(queryKey)) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false;\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false;\n }\n }\n\n var queryStatusFilter = mapQueryStatusFilter(active, inactive);\n\n if (queryStatusFilter === 'none') {\n return false;\n } else if (queryStatusFilter !== 'all') {\n var isActive = query.isActive();\n\n if (queryStatusFilter === 'active' && !isActive) {\n return false;\n }\n\n if (queryStatusFilter === 'inactive' && isActive) {\n return false;\n }\n }\n\n if (typeof stale === 'boolean' && query.isStale() !== stale) {\n return false;\n }\n\n if (typeof fetching === 'boolean' && query.isFetching() !== fetching) {\n return false;\n }\n\n if (predicate && !predicate(query)) {\n return false;\n }\n\n return true;\n}\nexport function matchMutation(filters, mutation) {\n var exact = filters.exact,\n fetching = filters.fetching,\n predicate = filters.predicate,\n mutationKey = filters.mutationKey;\n\n if (isQueryKey(mutationKey)) {\n if (!mutation.options.mutationKey) {\n return false;\n }\n\n if (exact) {\n if (hashQueryKey(mutation.options.mutationKey) !== hashQueryKey(mutationKey)) {\n return false;\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false;\n }\n }\n\n if (typeof fetching === 'boolean' && mutation.state.status === 'loading' !== fetching) {\n return false;\n }\n\n if (predicate && !predicate(mutation)) {\n return false;\n }\n\n return true;\n}\nexport function hashQueryKeyByOptions(queryKey, options) {\n var hashFn = (options == null ? void 0 : options.queryKeyHashFn) || hashQueryKey;\n return hashFn(queryKey);\n}\n/**\n * Default query keys hash function.\n */\n\nexport function hashQueryKey(queryKey) {\n var asArray = ensureQueryKeyArray(queryKey);\n return stableValueHash(asArray);\n}\n/**\n * Hashes the value into a stable hash.\n */\n\nexport function stableValueHash(value) {\n return JSON.stringify(value, function (_, val) {\n return isPlainObject(val) ? Object.keys(val).sort().reduce(function (result, key) {\n result[key] = val[key];\n return result;\n }, {}) : val;\n });\n}\n/**\n * Checks if key `b` partially matches with key `a`.\n */\n\nexport function partialMatchKey(a, b) {\n return partialDeepEqual(ensureQueryKeyArray(a), ensureQueryKeyArray(b));\n}\n/**\n * Checks if `b` partially matches with `a`.\n */\n\nexport function partialDeepEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (typeof a !== typeof b) {\n return false;\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n return !Object.keys(b).some(function (key) {\n return !partialDeepEqual(a[key], b[key]);\n });\n }\n\n return false;\n}\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\n\nexport function replaceEqualDeep(a, b) {\n if (a === b) {\n return a;\n }\n\n var array = Array.isArray(a) && Array.isArray(b);\n\n if (array || isPlainObject(a) && isPlainObject(b)) {\n var aSize = array ? a.length : Object.keys(a).length;\n var bItems = array ? b : Object.keys(b);\n var bSize = bItems.length;\n var copy = array ? [] : {};\n var equalItems = 0;\n\n for (var i = 0; i < bSize; i++) {\n var key = array ? i : bItems[i];\n copy[key] = replaceEqualDeep(a[key], b[key]);\n\n if (copy[key] === a[key]) {\n equalItems++;\n }\n }\n\n return aSize === bSize && equalItems === aSize ? a : copy;\n }\n\n return b;\n}\n/**\n * Shallow compare objects. Only works with objects that always have the same properties.\n */\n\nexport function shallowEqualObjects(a, b) {\n if (a && !b || b && !a) {\n return false;\n }\n\n for (var key in a) {\n if (a[key] !== b[key]) {\n return false;\n }\n }\n\n return true;\n} // Copied from: https://github.com/jonschlinkert/is-plain-object\n\nexport function isPlainObject(o) {\n if (!hasObjectPrototype(o)) {\n return false;\n } // If has modified constructor\n\n\n var ctor = o.constructor;\n\n if (typeof ctor === 'undefined') {\n return true;\n } // If has modified prototype\n\n\n var prot = ctor.prototype;\n\n if (!hasObjectPrototype(prot)) {\n return false;\n } // If constructor does not have an Object-specific method\n\n\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false;\n } // Most likely a plain Object\n\n\n return true;\n}\n\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nexport function isQueryKey(value) {\n return typeof value === 'string' || Array.isArray(value);\n}\nexport function isError(value) {\n return value instanceof Error;\n}\nexport function sleep(timeout) {\n return new Promise(function (resolve) {\n setTimeout(resolve, timeout);\n });\n}\n/**\n * Schedules a microtask.\n * This can be useful to schedule state updates after rendering.\n */\n\nexport function scheduleMicrotask(callback) {\n Promise.resolve().then(callback).catch(function (error) {\n return setTimeout(function () {\n throw error;\n });\n });\n}\nexport function getAbortController() {\n if (typeof AbortController === 'function') {\n return new AbortController();\n }\n}","import ReactDOM from 'react-dom';\nexport var unstable_batchedUpdates = ReactDOM.unstable_batchedUpdates;","import { notifyManager } from '../core';\nimport { unstable_batchedUpdates } from './reactBatchedUpdates';\nnotifyManager.setBatchNotifyFunction(unstable_batchedUpdates);","export var logger = console;","import { setLogger } from '../core';\nimport { logger } from './logger';\nsetLogger(logger);","import React from 'react';\nvar defaultContext = /*#__PURE__*/React.createContext(undefined);\nvar QueryClientSharingContext = /*#__PURE__*/React.createContext(false); // if contextSharing is on, we share the first and at least one\n// instance of the context across the window\n// to ensure that if React Query is used across\n// different bundles or microfrontends they will\n// all use the same **instance** of context, regardless\n// of module scoping.\n\nfunction getQueryClientContext(contextSharing) {\n if (contextSharing && typeof window !== 'undefined') {\n if (!window.ReactQueryClientContext) {\n window.ReactQueryClientContext = defaultContext;\n }\n\n return window.ReactQueryClientContext;\n }\n\n return defaultContext;\n}\n\nexport var useQueryClient = function useQueryClient() {\n var queryClient = React.useContext(getQueryClientContext(React.useContext(QueryClientSharingContext)));\n\n if (!queryClient) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one');\n }\n\n return queryClient;\n};\nexport var QueryClientProvider = function QueryClientProvider(_ref) {\n var client = _ref.client,\n _ref$contextSharing = _ref.contextSharing,\n contextSharing = _ref$contextSharing === void 0 ? false : _ref$contextSharing,\n children = _ref.children;\n React.useEffect(function () {\n client.mount();\n return function () {\n client.unmount();\n };\n }, [client]);\n var Context = getQueryClientContext(contextSharing);\n return /*#__PURE__*/React.createElement(QueryClientSharingContext.Provider, {\n value: contextSharing\n }, /*#__PURE__*/React.createElement(Context.Provider, {\n value: client\n }, children));\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport { isServer, isValidTimeout, noop, replaceEqualDeep, shallowEqualObjects, timeUntilStale } from './utils';\nimport { notifyManager } from './notifyManager';\nimport { focusManager } from './focusManager';\nimport { Subscribable } from './subscribable';\nimport { getLogger } from './logger';\nimport { isCancelledError } from './retryer';\nexport var QueryObserver = /*#__PURE__*/function (_Subscribable) {\n _inheritsLoose(QueryObserver, _Subscribable);\n\n function QueryObserver(client, options) {\n var _this;\n\n _this = _Subscribable.call(this) || this;\n _this.client = client;\n _this.options = options;\n _this.trackedProps = [];\n _this.previousSelectError = null;\n\n _this.bindMethods();\n\n _this.setOptions(options);\n\n return _this;\n }\n\n var _proto = QueryObserver.prototype;\n\n _proto.bindMethods = function bindMethods() {\n this.remove = this.remove.bind(this);\n this.refetch = this.refetch.bind(this);\n };\n\n _proto.onSubscribe = function onSubscribe() {\n if (this.listeners.length === 1) {\n this.currentQuery.addObserver(this);\n\n if (shouldFetchOnMount(this.currentQuery, this.options)) {\n this.executeFetch();\n }\n\n this.updateTimers();\n }\n };\n\n _proto.onUnsubscribe = function onUnsubscribe() {\n if (!this.listeners.length) {\n this.destroy();\n }\n };\n\n _proto.shouldFetchOnReconnect = function shouldFetchOnReconnect() {\n return _shouldFetchOnReconnect(this.currentQuery, this.options);\n };\n\n _proto.shouldFetchOnWindowFocus = function shouldFetchOnWindowFocus() {\n return _shouldFetchOnWindowFocus(this.currentQuery, this.options);\n };\n\n _proto.destroy = function destroy() {\n this.listeners = [];\n this.clearTimers();\n this.currentQuery.removeObserver(this);\n };\n\n _proto.setOptions = function setOptions(options, notifyOptions) {\n var prevOptions = this.options;\n var prevQuery = this.currentQuery;\n this.options = this.client.defaultQueryObserverOptions(options);\n\n if (typeof this.options.enabled !== 'undefined' && typeof this.options.enabled !== 'boolean') {\n throw new Error('Expected enabled to be a boolean');\n } // Keep previous query key if the user does not supply one\n\n\n if (!this.options.queryKey) {\n this.options.queryKey = prevOptions.queryKey;\n }\n\n this.updateQuery();\n var mounted = this.hasListeners(); // Fetch if there are subscribers\n\n if (mounted && shouldFetchOptionally(this.currentQuery, prevQuery, this.options, prevOptions)) {\n this.executeFetch();\n } // Update result\n\n\n this.updateResult(notifyOptions); // Update stale interval if needed\n\n if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || this.options.staleTime !== prevOptions.staleTime)) {\n this.updateStaleTimeout();\n }\n\n var nextRefetchInterval = this.computeRefetchInterval(); // Update refetch interval if needed\n\n if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || nextRefetchInterval !== this.currentRefetchInterval)) {\n this.updateRefetchInterval(nextRefetchInterval);\n }\n };\n\n _proto.getOptimisticResult = function getOptimisticResult(options) {\n var defaultedOptions = this.client.defaultQueryObserverOptions(options);\n var query = this.client.getQueryCache().build(this.client, defaultedOptions);\n return this.createResult(query, defaultedOptions);\n };\n\n _proto.getCurrentResult = function getCurrentResult() {\n return this.currentResult;\n };\n\n _proto.trackResult = function trackResult(result, defaultedOptions) {\n var _this2 = this;\n\n var trackedResult = {};\n\n var trackProp = function trackProp(key) {\n if (!_this2.trackedProps.includes(key)) {\n _this2.trackedProps.push(key);\n }\n };\n\n Object.keys(result).forEach(function (key) {\n Object.defineProperty(trackedResult, key, {\n configurable: false,\n enumerable: true,\n get: function get() {\n trackProp(key);\n return result[key];\n }\n });\n });\n\n if (defaultedOptions.useErrorBoundary || defaultedOptions.suspense) {\n trackProp('error');\n }\n\n return trackedResult;\n };\n\n _proto.getNextResult = function getNextResult(options) {\n var _this3 = this;\n\n return new Promise(function (resolve, reject) {\n var unsubscribe = _this3.subscribe(function (result) {\n if (!result.isFetching) {\n unsubscribe();\n\n if (result.isError && (options == null ? void 0 : options.throwOnError)) {\n reject(result.error);\n } else {\n resolve(result);\n }\n }\n });\n });\n };\n\n _proto.getCurrentQuery = function getCurrentQuery() {\n return this.currentQuery;\n };\n\n _proto.remove = function remove() {\n this.client.getQueryCache().remove(this.currentQuery);\n };\n\n _proto.refetch = function refetch(options) {\n return this.fetch(_extends({}, options, {\n meta: {\n refetchPage: options == null ? void 0 : options.refetchPage\n }\n }));\n };\n\n _proto.fetchOptimistic = function fetchOptimistic(options) {\n var _this4 = this;\n\n var defaultedOptions = this.client.defaultQueryObserverOptions(options);\n var query = this.client.getQueryCache().build(this.client, defaultedOptions);\n return query.fetch().then(function () {\n return _this4.createResult(query, defaultedOptions);\n });\n };\n\n _proto.fetch = function fetch(fetchOptions) {\n var _this5 = this;\n\n return this.executeFetch(fetchOptions).then(function () {\n _this5.updateResult();\n\n return _this5.currentResult;\n });\n };\n\n _proto.executeFetch = function executeFetch(fetchOptions) {\n // Make sure we reference the latest query as the current one might have been removed\n this.updateQuery(); // Fetch\n\n var promise = this.currentQuery.fetch(this.options, fetchOptions);\n\n if (!(fetchOptions == null ? void 0 : fetchOptions.throwOnError)) {\n promise = promise.catch(noop);\n }\n\n return promise;\n };\n\n _proto.updateStaleTimeout = function updateStaleTimeout() {\n var _this6 = this;\n\n this.clearStaleTimeout();\n\n if (isServer || this.currentResult.isStale || !isValidTimeout(this.options.staleTime)) {\n return;\n }\n\n var time = timeUntilStale(this.currentResult.dataUpdatedAt, this.options.staleTime); // The timeout is sometimes triggered 1 ms before the stale time expiration.\n // To mitigate this issue we always add 1 ms to the timeout.\n\n var timeout = time + 1;\n this.staleTimeoutId = setTimeout(function () {\n if (!_this6.currentResult.isStale) {\n _this6.updateResult();\n }\n }, timeout);\n };\n\n _proto.computeRefetchInterval = function computeRefetchInterval() {\n var _this$options$refetch;\n\n return typeof this.options.refetchInterval === 'function' ? this.options.refetchInterval(this.currentResult.data, this.currentQuery) : (_this$options$refetch = this.options.refetchInterval) != null ? _this$options$refetch : false;\n };\n\n _proto.updateRefetchInterval = function updateRefetchInterval(nextInterval) {\n var _this7 = this;\n\n this.clearRefetchInterval();\n this.currentRefetchInterval = nextInterval;\n\n if (isServer || this.options.enabled === false || !isValidTimeout(this.currentRefetchInterval) || this.currentRefetchInterval === 0) {\n return;\n }\n\n this.refetchIntervalId = setInterval(function () {\n if (_this7.options.refetchIntervalInBackground || focusManager.isFocused()) {\n _this7.executeFetch();\n }\n }, this.currentRefetchInterval);\n };\n\n _proto.updateTimers = function updateTimers() {\n this.updateStaleTimeout();\n this.updateRefetchInterval(this.computeRefetchInterval());\n };\n\n _proto.clearTimers = function clearTimers() {\n this.clearStaleTimeout();\n this.clearRefetchInterval();\n };\n\n _proto.clearStaleTimeout = function clearStaleTimeout() {\n clearTimeout(this.staleTimeoutId);\n this.staleTimeoutId = undefined;\n };\n\n _proto.clearRefetchInterval = function clearRefetchInterval() {\n clearInterval(this.refetchIntervalId);\n this.refetchIntervalId = undefined;\n };\n\n _proto.createResult = function createResult(query, options) {\n var prevQuery = this.currentQuery;\n var prevOptions = this.options;\n var prevResult = this.currentResult;\n var prevResultState = this.currentResultState;\n var prevResultOptions = this.currentResultOptions;\n var queryChange = query !== prevQuery;\n var queryInitialState = queryChange ? query.state : this.currentQueryInitialState;\n var prevQueryResult = queryChange ? this.currentResult : this.previousQueryResult;\n var state = query.state;\n var dataUpdatedAt = state.dataUpdatedAt,\n error = state.error,\n errorUpdatedAt = state.errorUpdatedAt,\n isFetching = state.isFetching,\n status = state.status;\n var isPreviousData = false;\n var isPlaceholderData = false;\n var data; // Optimistically set result in fetching state if needed\n\n if (options.optimisticResults) {\n var mounted = this.hasListeners();\n var fetchOnMount = !mounted && shouldFetchOnMount(query, options);\n var fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);\n\n if (fetchOnMount || fetchOptionally) {\n isFetching = true;\n\n if (!dataUpdatedAt) {\n status = 'loading';\n }\n }\n } // Keep previous data if needed\n\n\n if (options.keepPreviousData && !state.dataUpdateCount && (prevQueryResult == null ? void 0 : prevQueryResult.isSuccess) && status !== 'error') {\n data = prevQueryResult.data;\n dataUpdatedAt = prevQueryResult.dataUpdatedAt;\n status = prevQueryResult.status;\n isPreviousData = true;\n } // Select data if needed\n else if (options.select && typeof state.data !== 'undefined') {\n // Memoize select result\n if (prevResult && state.data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === (prevResultOptions == null ? void 0 : prevResultOptions.select) && !this.previousSelectError) {\n data = prevResult.data;\n } else {\n try {\n data = options.select(state.data);\n\n if (options.structuralSharing !== false) {\n data = replaceEqualDeep(prevResult == null ? void 0 : prevResult.data, data);\n }\n\n this.previousSelectError = null;\n } catch (selectError) {\n getLogger().error(selectError);\n error = selectError;\n this.previousSelectError = selectError;\n errorUpdatedAt = Date.now();\n status = 'error';\n }\n }\n } // Use query data\n else {\n data = state.data;\n } // Show placeholder data if needed\n\n\n if (typeof options.placeholderData !== 'undefined' && typeof data === 'undefined' && (status === 'loading' || status === 'idle')) {\n var placeholderData; // Memoize placeholder data\n\n if ((prevResult == null ? void 0 : prevResult.isPlaceholderData) && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) {\n placeholderData = prevResult.data;\n } else {\n placeholderData = typeof options.placeholderData === 'function' ? options.placeholderData() : options.placeholderData;\n\n if (options.select && typeof placeholderData !== 'undefined') {\n try {\n placeholderData = options.select(placeholderData);\n\n if (options.structuralSharing !== false) {\n placeholderData = replaceEqualDeep(prevResult == null ? void 0 : prevResult.data, placeholderData);\n }\n\n this.previousSelectError = null;\n } catch (selectError) {\n getLogger().error(selectError);\n error = selectError;\n this.previousSelectError = selectError;\n errorUpdatedAt = Date.now();\n status = 'error';\n }\n }\n }\n\n if (typeof placeholderData !== 'undefined') {\n status = 'success';\n data = placeholderData;\n isPlaceholderData = true;\n }\n }\n\n var result = {\n status: status,\n isLoading: status === 'loading',\n isSuccess: status === 'success',\n isError: status === 'error',\n isIdle: status === 'idle',\n data: data,\n dataUpdatedAt: dataUpdatedAt,\n error: error,\n errorUpdatedAt: errorUpdatedAt,\n failureCount: state.fetchFailureCount,\n isFetched: state.dataUpdateCount > 0 || state.errorUpdateCount > 0,\n isFetchedAfterMount: state.dataUpdateCount > queryInitialState.dataUpdateCount || state.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching: isFetching,\n isRefetching: isFetching && status !== 'loading',\n isLoadingError: status === 'error' && state.dataUpdatedAt === 0,\n isPlaceholderData: isPlaceholderData,\n isPreviousData: isPreviousData,\n isRefetchError: status === 'error' && state.dataUpdatedAt !== 0,\n isStale: isStale(query, options),\n refetch: this.refetch,\n remove: this.remove\n };\n return result;\n };\n\n _proto.shouldNotifyListeners = function shouldNotifyListeners(result, prevResult) {\n if (!prevResult) {\n return true;\n }\n\n var _this$options = this.options,\n notifyOnChangeProps = _this$options.notifyOnChangeProps,\n notifyOnChangePropsExclusions = _this$options.notifyOnChangePropsExclusions;\n\n if (!notifyOnChangeProps && !notifyOnChangePropsExclusions) {\n return true;\n }\n\n if (notifyOnChangeProps === 'tracked' && !this.trackedProps.length) {\n return true;\n }\n\n var includedProps = notifyOnChangeProps === 'tracked' ? this.trackedProps : notifyOnChangeProps;\n return Object.keys(result).some(function (key) {\n var typedKey = key;\n var changed = result[typedKey] !== prevResult[typedKey];\n var isIncluded = includedProps == null ? void 0 : includedProps.some(function (x) {\n return x === key;\n });\n var isExcluded = notifyOnChangePropsExclusions == null ? void 0 : notifyOnChangePropsExclusions.some(function (x) {\n return x === key;\n });\n return changed && !isExcluded && (!includedProps || isIncluded);\n });\n };\n\n _proto.updateResult = function updateResult(notifyOptions) {\n var prevResult = this.currentResult;\n this.currentResult = this.createResult(this.currentQuery, this.options);\n this.currentResultState = this.currentQuery.state;\n this.currentResultOptions = this.options; // Only notify if something has changed\n\n if (shallowEqualObjects(this.currentResult, prevResult)) {\n return;\n } // Determine which callbacks to trigger\n\n\n var defaultNotifyOptions = {\n cache: true\n };\n\n if ((notifyOptions == null ? void 0 : notifyOptions.listeners) !== false && this.shouldNotifyListeners(this.currentResult, prevResult)) {\n defaultNotifyOptions.listeners = true;\n }\n\n this.notify(_extends({}, defaultNotifyOptions, notifyOptions));\n };\n\n _proto.updateQuery = function updateQuery() {\n var query = this.client.getQueryCache().build(this.client, this.options);\n\n if (query === this.currentQuery) {\n return;\n }\n\n var prevQuery = this.currentQuery;\n this.currentQuery = query;\n this.currentQueryInitialState = query.state;\n this.previousQueryResult = this.currentResult;\n\n if (this.hasListeners()) {\n prevQuery == null ? void 0 : prevQuery.removeObserver(this);\n query.addObserver(this);\n }\n };\n\n _proto.onQueryUpdate = function onQueryUpdate(action) {\n var notifyOptions = {};\n\n if (action.type === 'success') {\n notifyOptions.onSuccess = true;\n } else if (action.type === 'error' && !isCancelledError(action.error)) {\n notifyOptions.onError = true;\n }\n\n this.updateResult(notifyOptions);\n\n if (this.hasListeners()) {\n this.updateTimers();\n }\n };\n\n _proto.notify = function notify(notifyOptions) {\n var _this8 = this;\n\n notifyManager.batch(function () {\n // First trigger the configuration callbacks\n if (notifyOptions.onSuccess) {\n _this8.options.onSuccess == null ? void 0 : _this8.options.onSuccess(_this8.currentResult.data);\n _this8.options.onSettled == null ? void 0 : _this8.options.onSettled(_this8.currentResult.data, null);\n } else if (notifyOptions.onError) {\n _this8.options.onError == null ? void 0 : _this8.options.onError(_this8.currentResult.error);\n _this8.options.onSettled == null ? void 0 : _this8.options.onSettled(undefined, _this8.currentResult.error);\n } // Then trigger the listeners\n\n\n if (notifyOptions.listeners) {\n _this8.listeners.forEach(function (listener) {\n listener(_this8.currentResult);\n });\n } // Then the cache listeners\n\n\n if (notifyOptions.cache) {\n _this8.client.getQueryCache().notify({\n query: _this8.currentQuery,\n type: 'observerResultsUpdated'\n });\n }\n });\n };\n\n return QueryObserver;\n}(Subscribable);\n\nfunction shouldLoadOnMount(query, options) {\n return options.enabled !== false && !query.state.dataUpdatedAt && !(query.state.status === 'error' && options.retryOnMount === false);\n}\n\nfunction shouldRefetchOnMount(query, options) {\n return options.enabled !== false && query.state.dataUpdatedAt > 0 && (options.refetchOnMount === 'always' || options.refetchOnMount !== false && isStale(query, options));\n}\n\nfunction shouldFetchOnMount(query, options) {\n return shouldLoadOnMount(query, options) || shouldRefetchOnMount(query, options);\n}\n\nfunction _shouldFetchOnReconnect(query, options) {\n return options.enabled !== false && (options.refetchOnReconnect === 'always' || options.refetchOnReconnect !== false && isStale(query, options));\n}\n\nfunction _shouldFetchOnWindowFocus(query, options) {\n return options.enabled !== false && (options.refetchOnWindowFocus === 'always' || options.refetchOnWindowFocus !== false && isStale(query, options));\n}\n\nfunction shouldFetchOptionally(query, prevQuery, options, prevOptions) {\n return options.enabled !== false && (query !== prevQuery || prevOptions.enabled === false) && (!options.suspense || query.state.status !== 'error' || prevOptions.enabled === false) && isStale(query, options);\n}\n\nfunction isStale(query, options) {\n return query.isStaleByTime(options.staleTime);\n}","import React from 'react'; // CONTEXT\n\nfunction createValue() {\n var _isReset = false;\n return {\n clearReset: function clearReset() {\n _isReset = false;\n },\n reset: function reset() {\n _isReset = true;\n },\n isReset: function isReset() {\n return _isReset;\n }\n };\n}\n\nvar QueryErrorResetBoundaryContext = /*#__PURE__*/React.createContext(createValue()); // HOOK\n\nexport var useQueryErrorResetBoundary = function useQueryErrorResetBoundary() {\n return React.useContext(QueryErrorResetBoundaryContext);\n}; // COMPONENT\n\nexport var QueryErrorResetBoundary = function QueryErrorResetBoundary(_ref) {\n var children = _ref.children;\n var value = React.useMemo(function () {\n return createValue();\n }, []);\n return /*#__PURE__*/React.createElement(QueryErrorResetBoundaryContext.Provider, {\n value: value\n }, typeof children === 'function' ? children(value) : children);\n};","import React from 'react';\nimport { notifyManager } from '../core/notifyManager';\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary';\nimport { useQueryClient } from './QueryClientProvider';\nimport { shouldThrowError } from './utils';\nexport function useBaseQuery(options, Observer) {\n var mountedRef = React.useRef(false);\n\n var _React$useState = React.useState(0),\n forceUpdate = _React$useState[1];\n\n var queryClient = useQueryClient();\n var errorResetBoundary = useQueryErrorResetBoundary();\n var defaultedOptions = queryClient.defaultQueryObserverOptions(options); // Make sure results are optimistically set in fetching state before subscribing or updating options\n\n defaultedOptions.optimisticResults = true; // Include callbacks in batch renders\n\n if (defaultedOptions.onError) {\n defaultedOptions.onError = notifyManager.batchCalls(defaultedOptions.onError);\n }\n\n if (defaultedOptions.onSuccess) {\n defaultedOptions.onSuccess = notifyManager.batchCalls(defaultedOptions.onSuccess);\n }\n\n if (defaultedOptions.onSettled) {\n defaultedOptions.onSettled = notifyManager.batchCalls(defaultedOptions.onSettled);\n }\n\n if (defaultedOptions.suspense) {\n // Always set stale time when using suspense to prevent\n // fetching again when directly mounting after suspending\n if (typeof defaultedOptions.staleTime !== 'number') {\n defaultedOptions.staleTime = 1000;\n } // Set cache time to 1 if the option has been set to 0\n // when using suspense to prevent infinite loop of fetches\n\n\n if (defaultedOptions.cacheTime === 0) {\n defaultedOptions.cacheTime = 1;\n }\n }\n\n if (defaultedOptions.suspense || defaultedOptions.useErrorBoundary) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n defaultedOptions.retryOnMount = false;\n }\n }\n\n var _React$useState2 = React.useState(function () {\n return new Observer(queryClient, defaultedOptions);\n }),\n observer = _React$useState2[0];\n\n var result = observer.getOptimisticResult(defaultedOptions);\n React.useEffect(function () {\n mountedRef.current = true;\n errorResetBoundary.clearReset();\n var unsubscribe = observer.subscribe(notifyManager.batchCalls(function () {\n if (mountedRef.current) {\n forceUpdate(function (x) {\n return x + 1;\n });\n }\n })); // Update result to make sure we did not miss any query updates\n // between creating the observer and subscribing to it.\n\n observer.updateResult();\n return function () {\n mountedRef.current = false;\n unsubscribe();\n };\n }, [errorResetBoundary, observer]);\n React.useEffect(function () {\n // Do not notify on updates because of changes in the options because\n // these changes should already be reflected in the optimistic result.\n observer.setOptions(defaultedOptions, {\n listeners: false\n });\n }, [defaultedOptions, observer]); // Handle suspense\n\n if (defaultedOptions.suspense && result.isLoading) {\n throw observer.fetchOptimistic(defaultedOptions).then(function (_ref) {\n var data = _ref.data;\n defaultedOptions.onSuccess == null ? void 0 : defaultedOptions.onSuccess(data);\n defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(data, null);\n }).catch(function (error) {\n errorResetBoundary.clearReset();\n defaultedOptions.onError == null ? void 0 : defaultedOptions.onError(error);\n defaultedOptions.onSettled == null ? void 0 : defaultedOptions.onSettled(undefined, error);\n });\n } // Handle error boundary\n\n\n if (result.isError && !errorResetBoundary.isReset() && !result.isFetching && shouldThrowError(defaultedOptions.suspense, defaultedOptions.useErrorBoundary, result.error)) {\n throw result.error;\n } // Handle result property usage tracking\n\n\n if (defaultedOptions.notifyOnChangeProps === 'tracked') {\n result = observer.trackResult(result, defaultedOptions);\n }\n\n return result;\n}","export function shouldThrowError(suspense, _useErrorBoundary, error) {\n // Allow useErrorBoundary function to override throwing behavior on a per-error basis\n if (typeof _useErrorBoundary === 'function') {\n return _useErrorBoundary(error);\n } // Allow useErrorBoundary to override suspense's throwing behavior\n\n\n if (typeof _useErrorBoundary === 'boolean') return _useErrorBoundary; // If suspense is enabled default to throwing errors\n\n return !!suspense;\n}","import { QueryObserver } from '../core';\nimport { parseQueryArgs } from '../core/utils';\nimport { useBaseQuery } from './useBaseQuery'; // HOOK\n\nexport function useQuery(arg1, arg2, arg3) {\n var parsedOptions = parseQueryArgs(arg1, arg2, arg3);\n return useBaseQuery(parsedOptions, QueryObserver);\n}","/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1 result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n defineProperty(this, \"_invoke\", { value: enqueue });\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(val) {\n var object = Object(val);\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","/**\n * @license React\n * scheduler.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';function f(a,b){var c=a.length;a.push(b);a:for(;0>>1,e=a[d];if(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(ng(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","\nmodule.exports = function () {\n var selection = document.getSelection();\n if (!selection.rangeCount) {\n return function () {};\n }\n var active = document.activeElement;\n\n var ranges = [];\n for (var i = 0; i < selection.rangeCount; i++) {\n ranges.push(selection.getRangeAt(i));\n }\n\n switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML\n case 'INPUT':\n case 'TEXTAREA':\n active.blur();\n break;\n\n default:\n active = null;\n break;\n }\n\n selection.removeAllRanges();\n return function () {\n selection.type === 'Caret' &&\n selection.removeAllRanges();\n\n if (!selection.rangeCount) {\n ranges.forEach(function(range) {\n selection.addRange(range);\n });\n }\n\n active &&\n active.focus();\n };\n};\n","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","export default function _asyncIterator(iterable) {\n var method,\n async,\n sync,\n retry = 2;\n\n for (\"undefined\" != typeof Symbol && (async = Symbol.asyncIterator, sync = Symbol.iterator); retry--;) {\n if (async && null != (method = iterable[async])) return method.call(iterable);\n if (sync && null != (method = iterable[sync])) return new AsyncFromSyncIterator(method.call(iterable));\n async = \"@@asyncIterator\", sync = \"@@iterator\";\n }\n\n throw new TypeError(\"Object is not async iterable\");\n}\n\nfunction AsyncFromSyncIterator(s) {\n function AsyncFromSyncIteratorContinuation(r) {\n if (Object(r) !== r) return Promise.reject(new TypeError(r + \" is not an object.\"));\n var done = r.done;\n return Promise.resolve(r.value).then(function (value) {\n return {\n value: value,\n done: done\n };\n });\n }\n\n return AsyncFromSyncIterator = function AsyncFromSyncIterator(s) {\n this.s = s, this.n = s.next;\n }, AsyncFromSyncIterator.prototype = {\n s: null,\n n: null,\n next: function next() {\n return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));\n },\n \"return\": function _return(value) {\n var ret = this.s[\"return\"];\n return void 0 === ret ? Promise.resolve({\n value: value,\n done: !0\n }) : AsyncFromSyncIteratorContinuation(ret.apply(this.s, arguments));\n },\n \"throw\": function _throw(value) {\n var thr = this.s[\"return\"];\n return void 0 === thr ? Promise.reject(value) : AsyncFromSyncIteratorContinuation(thr.apply(this.s, arguments));\n }\n }, new AsyncFromSyncIterator(s);\n}","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}","import unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nexport default function _createForOfIteratorHelper(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n\n if (!it) {\n if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n\n var F = function F() {};\n\n return {\n s: F,\n n: function n() {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n },\n e: function e(_e) {\n throw _e;\n },\n f: F\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n var normalCompletion = true,\n didErr = false,\n err;\n return {\n s: function s() {\n it = it.call(o);\n },\n n: function n() {\n var step = it.next();\n normalCompletion = step.done;\n return step;\n },\n e: function e(_e2) {\n didErr = true;\n err = _e2;\n },\n f: function f() {\n try {\n if (!normalCompletion && it[\"return\"] != null) it[\"return\"]();\n } finally {\n if (didErr) throw err;\n }\n }\n };\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import _typeof from \"./typeof.js\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return assertThisInitialized(self);\n}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nimport possibleConstructorReturn from \"./possibleConstructorReturn.js\";\nexport default function _createSuper(Derived) {\n var hasNativeReflectConstruct = isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = getPrototypeOf(Derived),\n result;\n\n if (hasNativeReflectConstruct) {\n var NewTarget = getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n\n return possibleConstructorReturn(this, result);\n };\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","export default function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nexport default function _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct;\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeFunction from \"./isNativeFunction.js\";\nimport construct from \"./construct.js\";\nexport default function _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"@babel/runtime/helpers/esm/setPrototypeOf\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","/**\n * Represents a location in a Source.\n */\n\n/**\n * Takes a Source and a UTF-8 character offset, and returns the corresponding\n * line and column as a SourceLocation.\n */\nexport function getLocation(source, position) {\n var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}\n","import { getLocation } from \"./location.mjs\";\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printLocation(location) {\n return printSourceLocation(location.source, getLocation(location.source, location.start));\n}\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printSourceLocation(source, sourceLocation) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = sourceLocation.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = sourceLocation.line + lineOffset;\n var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = sourceLocation.column + columnOffset;\n var locationStr = \"\".concat(source.name, \":\").concat(lineNum, \":\").concat(columnNum, \"\\n\");\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n var locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n var subLineIndex = Math.floor(columnNum / 80);\n var subLineColumnNum = columnNum % 80;\n var subLines = [];\n\n for (var i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return locationStr + printPrefixedLines([[\"\".concat(lineNum), subLines[0]]].concat(subLines.slice(1, subLineIndex + 1).map(function (subLine) {\n return ['', subLine];\n }), [[' ', whitespace(subLineColumnNum - 1) + '^'], ['', subLines[subLineIndex + 1]]]));\n }\n\n return locationStr + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1), lines[lineIndex - 1]], [\"\".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1), lines[lineIndex + 1]]]);\n}\n\nfunction printPrefixedLines(lines) {\n var existingLines = lines.filter(function (_ref) {\n var _ = _ref[0],\n line = _ref[1];\n return line !== undefined;\n });\n var padLen = Math.max.apply(Math, existingLines.map(function (_ref2) {\n var prefix = _ref2[0];\n return prefix.length;\n }));\n return existingLines.map(function (_ref3) {\n var prefix = _ref3[0],\n line = _ref3[1];\n return leftPad(padLen, prefix) + (line ? ' | ' + line : ' |');\n }).join('\\n');\n}\n\nfunction whitespace(len) {\n return Array(len + 1).join(' ');\n}\n\nfunction leftPad(len, str) {\n return whitespace(len - str.length) + str;\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n// FIXME:\n// flowlint uninitialized-instance-property:off\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport { getLocation } from \"../language/location.mjs\";\nimport { printLocation, printSourceLocation } from \"../language/printLocation.mjs\";\n/**\n * A GraphQLError describes an Error found during the parse, validate, or\n * execute phases of performing a GraphQL operation. In addition to a message\n * and stack trace, it also includes information about the locations in a\n * GraphQL document and/or execution result that correspond to the Error.\n */\n\nexport var GraphQLError = /*#__PURE__*/function (_Error) {\n _inherits(GraphQLError, _Error);\n\n var _super = _createSuper(GraphQLError);\n\n /**\n * A message describing the Error for debugging purposes.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n *\n * Note: should be treated as readonly, despite invariant usage.\n */\n\n /**\n * An array of { line, column } locations within the source GraphQL document\n * which correspond to this error.\n *\n * Errors during validation often contain multiple locations, for example to\n * point out two things with the same name. Errors during execution include a\n * single location, the field which produced the error.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array describing the JSON-path into the execution response which\n * corresponds to this error. Only included for errors during execution.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array of GraphQL AST Nodes corresponding to this error.\n */\n\n /**\n * The source GraphQL document for the first location of this error.\n *\n * Note that if this Error represents more than one node, the source may not\n * represent nodes after the first node.\n */\n\n /**\n * An array of character offsets within the source GraphQL document\n * which correspond to this error.\n */\n\n /**\n * The original error thrown from a field resolver during execution.\n */\n\n /**\n * Extension fields to add to the formatted error.\n */\n function GraphQLError(message, nodes, source, positions, path, originalError, extensions) {\n var _locations2, _source2, _positions2, _extensions2;\n\n var _this;\n\n _classCallCheck(this, GraphQLError);\n\n _this = _super.call(this, message); // Compute list of blame nodes.\n\n var _nodes = Array.isArray(nodes) ? nodes.length !== 0 ? nodes : undefined : nodes ? [nodes] : undefined; // Compute locations in the source for the given nodes/positions.\n\n\n var _source = source;\n\n if (!_source && _nodes) {\n var _nodes$0$loc;\n\n _source = (_nodes$0$loc = _nodes[0].loc) === null || _nodes$0$loc === void 0 ? void 0 : _nodes$0$loc.source;\n }\n\n var _positions = positions;\n\n if (!_positions && _nodes) {\n _positions = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(node.loc.start);\n }\n\n return list;\n }, []);\n }\n\n if (_positions && _positions.length === 0) {\n _positions = undefined;\n }\n\n var _locations;\n\n if (positions && source) {\n _locations = positions.map(function (pos) {\n return getLocation(source, pos);\n });\n } else if (_nodes) {\n _locations = _nodes.reduce(function (list, node) {\n if (node.loc) {\n list.push(getLocation(node.loc.source, node.loc.start));\n }\n\n return list;\n }, []);\n }\n\n var _extensions = extensions;\n\n if (_extensions == null && originalError != null) {\n var originalExtensions = originalError.extensions;\n\n if (isObjectLike(originalExtensions)) {\n _extensions = originalExtensions;\n }\n }\n\n Object.defineProperties(_assertThisInitialized(_this), {\n name: {\n value: 'GraphQLError'\n },\n message: {\n value: message,\n // By being enumerable, JSON.stringify will include `message` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: true,\n writable: true\n },\n locations: {\n // Coercing falsy values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: (_locations2 = _locations) !== null && _locations2 !== void 0 ? _locations2 : undefined,\n // By being enumerable, JSON.stringify will include `locations` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: _locations != null\n },\n path: {\n // Coercing falsy values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: path !== null && path !== void 0 ? path : undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: path != null\n },\n nodes: {\n value: _nodes !== null && _nodes !== void 0 ? _nodes : undefined\n },\n source: {\n value: (_source2 = _source) !== null && _source2 !== void 0 ? _source2 : undefined\n },\n positions: {\n value: (_positions2 = _positions) !== null && _positions2 !== void 0 ? _positions2 : undefined\n },\n originalError: {\n value: originalError\n },\n extensions: {\n // Coercing falsy values to undefined ensures they will not be included\n // in JSON.stringify() when not provided.\n value: (_extensions2 = _extensions) !== null && _extensions2 !== void 0 ? _extensions2 : undefined,\n // By being enumerable, JSON.stringify will include `path` in the\n // resulting output. This ensures that the simplest possible GraphQL\n // service adheres to the spec.\n enumerable: _extensions != null\n }\n }); // Include (non-enumerable) stack trace.\n\n if (originalError !== null && originalError !== void 0 && originalError.stack) {\n Object.defineProperty(_assertThisInitialized(_this), 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true\n });\n return _possibleConstructorReturn(_this);\n } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(_assertThisInitialized(_this), GraphQLError);\n } else {\n Object.defineProperty(_assertThisInitialized(_this), 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true\n });\n }\n\n return _this;\n }\n\n _createClass(GraphQLError, [{\n key: \"toString\",\n value: function toString() {\n return printError(this);\n } // FIXME: workaround to not break chai comparisons, should be remove in v16\n // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n\n }, {\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'Object';\n }\n }]);\n\n return GraphQLError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n/**\n * Prints a GraphQLError to a string, representing useful location information\n * about the error's position in the source.\n */\n\nexport function printError(error) {\n var output = error.message;\n\n if (error.nodes) {\n for (var _i2 = 0, _error$nodes2 = error.nodes; _i2 < _error$nodes2.length; _i2++) {\n var node = _error$nodes2[_i2];\n\n if (node.loc) {\n output += '\\n\\n' + printLocation(node.loc);\n }\n }\n } else if (error.source && error.locations) {\n for (var _i4 = 0, _error$locations2 = error.locations; _i4 < _error$locations2.length; _i4++) {\n var location = _error$locations2[_i4];\n output += '\\n\\n' + printSourceLocation(error.source, location);\n }\n }\n\n return output;\n}\n","import invariant from \"./invariant.mjs\";\nimport nodejsCustomInspectSymbol from \"./nodejsCustomInspectSymbol.mjs\";\n/**\n * The `defineInspect()` function defines `inspect()` prototype method as alias of `toJSON`\n */\n\nexport default function defineInspect(classObject) {\n var fn = classObject.prototype.toJSON;\n typeof fn === 'function' || invariant(0);\n classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n if (nodejsCustomInspectSymbol) {\n classObject.prototype[nodejsCustomInspectSymbol] = fn;\n }\n}\n","export default function devAssert(condition, message) {\n var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')\n\n if (!booleanCondition) {\n throw new Error(message);\n }\n}\n","var MAX_SUGGESTIONS = 5;\n/**\n * Given [ A, B, C ] return ' Did you mean A, B, or C?'.\n */\n\n// eslint-disable-next-line no-redeclare\nexport default function didYouMean(firstArg, secondArg) {\n var _ref = typeof firstArg === 'string' ? [firstArg, secondArg] : [undefined, firstArg],\n subMessage = _ref[0],\n suggestionsArg = _ref[1];\n\n var message = ' Did you mean ';\n\n if (subMessage) {\n message += subMessage + ' ';\n }\n\n var suggestions = suggestionsArg.map(function (x) {\n return \"\\\"\".concat(x, \"\\\"\");\n });\n\n switch (suggestions.length) {\n case 0:\n return '';\n\n case 1:\n return message + suggestions[0] + '?';\n\n case 2:\n return message + suggestions[0] + ' or ' + suggestions[1] + '?';\n }\n\n var selected = suggestions.slice(0, MAX_SUGGESTIONS);\n var lastItem = selected.pop();\n return message + selected.join(', ') + ', or ' + lastItem + '?';\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-disable flowtype/no-weak-types */\nimport nodejsCustomInspectSymbol from \"./nodejsCustomInspectSymbol.mjs\";\nvar MAX_ARRAY_LENGTH = 10;\nvar MAX_RECURSIVE_DEPTH = 2;\n/**\n * Used to print values in error messages.\n */\n\nexport default function inspect(value) {\n return formatValue(value, []);\n}\n\nfunction formatValue(value, seenValues) {\n switch (_typeof(value)) {\n case 'string':\n return JSON.stringify(value);\n\n case 'function':\n return value.name ? \"[function \".concat(value.name, \"]\") : '[function]';\n\n case 'object':\n if (value === null) {\n return 'null';\n }\n\n return formatObjectValue(value, seenValues);\n\n default:\n return String(value);\n }\n}\n\nfunction formatObjectValue(value, previouslySeenValues) {\n if (previouslySeenValues.indexOf(value) !== -1) {\n return '[Circular]';\n }\n\n var seenValues = [].concat(previouslySeenValues, [value]);\n var customInspectFn = getCustomFn(value);\n\n if (customInspectFn !== undefined) {\n var customValue = customInspectFn.call(value); // check for infinite recursion\n\n if (customValue !== value) {\n return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues);\n }\n } else if (Array.isArray(value)) {\n return formatArray(value, seenValues);\n }\n\n return formatObject(value, seenValues);\n}\n\nfunction formatObject(object, seenValues) {\n var keys = Object.keys(object);\n\n if (keys.length === 0) {\n return '{}';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[' + getObjectTag(object) + ']';\n }\n\n var properties = keys.map(function (key) {\n var value = formatValue(object[key], seenValues);\n return key + ': ' + value;\n });\n return '{ ' + properties.join(', ') + ' }';\n}\n\nfunction formatArray(array, seenValues) {\n if (array.length === 0) {\n return '[]';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[Array]';\n }\n\n var len = Math.min(MAX_ARRAY_LENGTH, array.length);\n var remaining = array.length - len;\n var items = [];\n\n for (var i = 0; i < len; ++i) {\n items.push(formatValue(array[i], seenValues));\n }\n\n if (remaining === 1) {\n items.push('... 1 more item');\n } else if (remaining > 1) {\n items.push(\"... \".concat(remaining, \" more items\"));\n }\n\n return '[' + items.join(', ') + ']';\n}\n\nfunction getCustomFn(object) {\n var customInspectFn = object[String(nodejsCustomInspectSymbol)];\n\n if (typeof customInspectFn === 'function') {\n return customInspectFn;\n }\n\n if (typeof object.inspect === 'function') {\n return object.inspect;\n }\n}\n\nfunction getObjectTag(object) {\n var tag = Object.prototype.toString.call(object).replace(/^\\[object /, '').replace(/]$/, '');\n\n if (tag === 'Object' && typeof object.constructor === 'function') {\n var name = object.constructor.name;\n\n if (typeof name === 'string' && name !== '') {\n return name;\n }\n }\n\n return tag;\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport inspect from \"./inspect.mjs\";\n/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n */\n\n// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n// See: https://webpack.js.org/guides/production/\nexport default process.env.NODE_ENV === 'production' ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n// eslint-disable-next-line no-shadow\nfunction instanceOf(value, constructor) {\n return value instanceof constructor;\n} : // eslint-disable-next-line no-shadow\nfunction instanceOf(value, constructor) {\n if (value instanceof constructor) {\n return true;\n }\n\n if (_typeof(value) === 'object' && value !== null) {\n var _value$constructor;\n\n var className = constructor.prototype[Symbol.toStringTag];\n var valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library.\n Symbol.toStringTag in value ? value[Symbol.toStringTag] : (_value$constructor = value.constructor) === null || _value$constructor === void 0 ? void 0 : _value$constructor.name;\n\n if (className === valueClassName) {\n var stringifiedValue = inspect(value);\n throw new Error(\"Cannot use \".concat(className, \" \\\"\").concat(stringifiedValue, \"\\\" from another module or realm.\\n\\nEnsure that there is only one instance of \\\"graphql\\\" in the node_modules\\ndirectory. If different versions of \\\"graphql\\\" are the dependencies of other\\nrelied on modules, use \\\"resolutions\\\" to ensure only one version is installed.\\n\\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\\n\\nDuplicate \\\"graphql\\\" modules cannot be used at the same time since different\\nversions may have different capabilities and behavior. The data from one\\nversion used in the function from another could produce confusing and\\nspurious results.\"));\n }\n }\n\n return false;\n};\n","export default function invariant(condition, message) {\n var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')\n\n if (!booleanCondition) {\n throw new Error(message != null ? message : 'Unexpected invariant triggered.');\n }\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/**\n * Return true if `value` is object-like. A value is object-like if it's not\n * `null` and has a `typeof` result of \"object\".\n */\nexport default function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}\n","/**\n * Creates a keyed JS object from an array, given a function to produce the keys\n * for each value in the array.\n *\n * This provides a convenient lookup for the array items if the key function\n * produces unique results.\n *\n * const phoneBook = [\n * { name: 'Jon', num: '555-1234' },\n * { name: 'Jenny', num: '867-5309' }\n * ]\n *\n * // { Jon: { name: 'Jon', num: '555-1234' },\n * // Jenny: { name: 'Jenny', num: '867-5309' } }\n * const entriesByName = keyMap(\n * phoneBook,\n * entry => entry.name\n * )\n *\n * // { name: 'Jenny', num: '857-6309' }\n * const jennyEntry = entriesByName['Jenny']\n *\n */\nexport default function keyMap(list, keyFn) {\n return list.reduce(function (map, item) {\n map[keyFn(item)] = item;\n return map;\n }, Object.create(null));\n}\n","/**\n * Creates a keyed JS object from an array, given a function to produce the keys\n * and a function to produce the values from each item in the array.\n *\n * const phoneBook = [\n * { name: 'Jon', num: '555-1234' },\n * { name: 'Jenny', num: '867-5309' }\n * ]\n *\n * // { Jon: '555-1234', Jenny: '867-5309' }\n * const phonesByName = keyValMap(\n * phoneBook,\n * entry => entry.name,\n * entry => entry.num\n * )\n *\n */\nexport default function keyValMap(list, keyFn, valFn) {\n return list.reduce(function (map, item) {\n map[keyFn(item)] = valFn(item);\n return map;\n }, Object.create(null));\n}\n","/**\n * Returns a number indicating whether a reference string comes before, or after,\n * or is the same as the given string in natural sort order.\n *\n * See: https://en.wikipedia.org/wiki/Natural_sort_order\n *\n */\nexport default function naturalCompare(aStr, bStr) {\n var aIdx = 0;\n var bIdx = 0;\n\n while (aIdx < aStr.length && bIdx < bStr.length) {\n var aChar = aStr.charCodeAt(aIdx);\n var bChar = bStr.charCodeAt(bIdx);\n\n if (isDigit(aChar) && isDigit(bChar)) {\n var aNum = 0;\n\n do {\n ++aIdx;\n aNum = aNum * 10 + aChar - DIGIT_0;\n aChar = aStr.charCodeAt(aIdx);\n } while (isDigit(aChar) && aNum > 0);\n\n var bNum = 0;\n\n do {\n ++bIdx;\n bNum = bNum * 10 + bChar - DIGIT_0;\n bChar = bStr.charCodeAt(bIdx);\n } while (isDigit(bChar) && bNum > 0);\n\n if (aNum < bNum) {\n return -1;\n }\n\n if (aNum > bNum) {\n return 1;\n }\n } else {\n if (aChar < bChar) {\n return -1;\n }\n\n if (aChar > bChar) {\n return 1;\n }\n\n ++aIdx;\n ++bIdx;\n }\n }\n\n return aStr.length - bStr.length;\n}\nvar DIGIT_0 = 48;\nvar DIGIT_9 = 57;\n\nfunction isDigit(code) {\n return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9;\n}\n","// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\nvar nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined;\nexport default nodejsCustomInspectSymbol;\n","import naturalCompare from \"./naturalCompare.mjs\";\n/**\n * Given an invalid input string and a list of valid options, returns a filtered\n * list of valid options sorted based on their similarity with the input.\n */\n\nexport default function suggestionList(input, options) {\n var optionsByDistance = Object.create(null);\n var lexicalDistance = new LexicalDistance(input);\n var threshold = Math.floor(input.length * 0.4) + 1;\n\n for (var _i2 = 0; _i2 < options.length; _i2++) {\n var option = options[_i2];\n var distance = lexicalDistance.measure(option, threshold);\n\n if (distance !== undefined) {\n optionsByDistance[option] = distance;\n }\n }\n\n return Object.keys(optionsByDistance).sort(function (a, b) {\n var distanceDiff = optionsByDistance[a] - optionsByDistance[b];\n return distanceDiff !== 0 ? distanceDiff : naturalCompare(a, b);\n });\n}\n/**\n * Computes the lexical distance between strings A and B.\n *\n * The \"distance\" between two strings is given by counting the minimum number\n * of edits needed to transform string A into string B. An edit can be an\n * insertion, deletion, or substitution of a single character, or a swap of two\n * adjacent characters.\n *\n * Includes a custom alteration from Damerau-Levenshtein to treat case changes\n * as a single edit which helps identify mis-cased values with an edit distance\n * of 1.\n *\n * This distance can be useful for detecting typos in input or sorting\n */\n\nvar LexicalDistance = /*#__PURE__*/function () {\n function LexicalDistance(input) {\n this._input = input;\n this._inputLowerCase = input.toLowerCase();\n this._inputArray = stringToArray(this._inputLowerCase);\n this._rows = [new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0)];\n }\n\n var _proto = LexicalDistance.prototype;\n\n _proto.measure = function measure(option, threshold) {\n if (this._input === option) {\n return 0;\n }\n\n var optionLowerCase = option.toLowerCase(); // Any case change counts as a single edit\n\n if (this._inputLowerCase === optionLowerCase) {\n return 1;\n }\n\n var a = stringToArray(optionLowerCase);\n var b = this._inputArray;\n\n if (a.length < b.length) {\n var tmp = a;\n a = b;\n b = tmp;\n }\n\n var aLength = a.length;\n var bLength = b.length;\n\n if (aLength - bLength > threshold) {\n return undefined;\n }\n\n var rows = this._rows;\n\n for (var j = 0; j <= bLength; j++) {\n rows[0][j] = j;\n }\n\n for (var i = 1; i <= aLength; i++) {\n var upRow = rows[(i - 1) % 3];\n var currentRow = rows[i % 3];\n var smallestCell = currentRow[0] = i;\n\n for (var _j = 1; _j <= bLength; _j++) {\n var cost = a[i - 1] === b[_j - 1] ? 0 : 1;\n var currentCell = Math.min(upRow[_j] + 1, // delete\n currentRow[_j - 1] + 1, // insert\n upRow[_j - 1] + cost // substitute\n );\n\n if (i > 1 && _j > 1 && a[i - 1] === b[_j - 2] && a[i - 2] === b[_j - 1]) {\n // transposition\n var doubleDiagonalCell = rows[(i - 2) % 3][_j - 2];\n currentCell = Math.min(currentCell, doubleDiagonalCell + 1);\n }\n\n if (currentCell < smallestCell) {\n smallestCell = currentCell;\n }\n\n currentRow[_j] = currentCell;\n } // Early exit, since distance can't go smaller than smallest element of the previous row.\n\n\n if (smallestCell > threshold) {\n return undefined;\n }\n }\n\n var distance = rows[aLength % 3][bLength];\n return distance <= threshold ? distance : undefined;\n };\n\n return LexicalDistance;\n}();\n\nfunction stringToArray(str) {\n var strLength = str.length;\n var array = new Array(strLength);\n\n for (var i = 0; i < strLength; ++i) {\n array[i] = str.charCodeAt(i);\n }\n\n return array;\n}\n","import objectEntries from \"../polyfills/objectEntries.mjs\";\nexport default function toObjMap(obj) {\n /* eslint-enable no-redeclare */\n if (Object.getPrototypeOf(obj) === null) {\n return obj;\n }\n\n var map = Object.create(null);\n\n for (var _i2 = 0, _objectEntries2 = objectEntries(obj); _i2 < _objectEntries2.length; _i2++) {\n var _ref2 = _objectEntries2[_i2];\n var key = _ref2[0];\n var value = _ref2[1];\n map[key] = value;\n }\n\n return map;\n}\n","import defineInspect from \"../jsutils/defineInspect.mjs\";\n\n/**\n * Contains a range of UTF-8 character offsets and token references that\n * identify the region of the source from which the AST derived.\n */\nexport var Location = /*#__PURE__*/function () {\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The Token at which this Node begins.\n */\n\n /**\n * The Token at which this Node ends.\n */\n\n /**\n * The Source document the AST represents.\n */\n function Location(startToken, endToken, source) {\n this.start = startToken.start;\n this.end = endToken.end;\n this.startToken = startToken;\n this.endToken = endToken;\n this.source = source;\n }\n\n var _proto = Location.prototype;\n\n _proto.toJSON = function toJSON() {\n return {\n start: this.start,\n end: this.end\n };\n };\n\n return Location;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(Location);\n/**\n * Represents a range of characters represented by a lexical token\n * within a Source.\n */\n\nexport var Token = /*#__PURE__*/function () {\n /**\n * The kind of Token.\n */\n\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The 1-indexed line number on which this Token appears.\n */\n\n /**\n * The 1-indexed column number at which this Token begins.\n */\n\n /**\n * For non-punctuation tokens, represents the interpreted value of the token.\n */\n\n /**\n * Tokens exist as nodes in a double-linked-list amongst all tokens\n * including ignored tokens. is always the first node and \n * the last.\n */\n function Token(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n }\n\n var _proto2 = Token.prototype;\n\n _proto2.toJSON = function toJSON() {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column\n };\n };\n\n return Token;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(Token);\n/**\n * @internal\n */\n\nexport function isNode(maybeNode) {\n return maybeNode != null && typeof maybeNode.kind === 'string';\n}\n/**\n * The list of all possible AST node types.\n */\n","/**\n * Produces the value of a block string from its parsed raw value, similar to\n * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n *\n * @internal\n */\nexport function dedentBlockStringValue(rawString) {\n // Expand a block string's raw value into independent lines.\n var lines = rawString.split(/\\r\\n|[\\n\\r]/g); // Remove common indentation from all lines but first.\n\n var commonIndent = getBlockStringIndentation(rawString);\n\n if (commonIndent !== 0) {\n for (var i = 1; i < lines.length; i++) {\n lines[i] = lines[i].slice(commonIndent);\n }\n } // Remove leading and trailing blank lines.\n\n\n var startLine = 0;\n\n while (startLine < lines.length && isBlank(lines[startLine])) {\n ++startLine;\n }\n\n var endLine = lines.length;\n\n while (endLine > startLine && isBlank(lines[endLine - 1])) {\n --endLine;\n } // Return a string of the lines joined with U+000A.\n\n\n return lines.slice(startLine, endLine).join('\\n');\n}\n\nfunction isBlank(str) {\n for (var i = 0; i < str.length; ++i) {\n if (str[i] !== ' ' && str[i] !== '\\t') {\n return false;\n }\n }\n\n return true;\n}\n/**\n * @internal\n */\n\n\nexport function getBlockStringIndentation(value) {\n var _commonIndent;\n\n var isFirstLine = true;\n var isEmptyLine = true;\n var indent = 0;\n var commonIndent = null;\n\n for (var i = 0; i < value.length; ++i) {\n switch (value.charCodeAt(i)) {\n case 13:\n // \\r\n if (value.charCodeAt(i + 1) === 10) {\n ++i; // skip \\r\\n as one symbol\n }\n\n // falls through\n\n case 10:\n // \\n\n isFirstLine = false;\n isEmptyLine = true;\n indent = 0;\n break;\n\n case 9: // \\t\n\n case 32:\n // \n ++indent;\n break;\n\n default:\n if (isEmptyLine && !isFirstLine && (commonIndent === null || indent < commonIndent)) {\n commonIndent = indent;\n }\n\n isEmptyLine = false;\n }\n }\n\n return (_commonIndent = commonIndent) !== null && _commonIndent !== void 0 ? _commonIndent : 0;\n}\n/**\n * Print a block string in the indented block form by adding a leading and\n * trailing blank line. However, if a block string starts with whitespace and is\n * a single-line, adding a leading blank line would strip that whitespace.\n *\n * @internal\n */\n\nexport function printBlockString(value) {\n var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var preferMultipleLines = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var isSingleLine = value.indexOf('\\n') === -1;\n var hasLeadingSpace = value[0] === ' ' || value[0] === '\\t';\n var hasTrailingQuote = value[value.length - 1] === '\"';\n var hasTrailingSlash = value[value.length - 1] === '\\\\';\n var printAsMultipleLines = !isSingleLine || hasTrailingQuote || hasTrailingSlash || preferMultipleLines;\n var result = ''; // Format a multi-line block quote to account for leading space.\n\n if (printAsMultipleLines && !(isSingleLine && hasLeadingSpace)) {\n result += '\\n' + indentation;\n }\n\n result += indentation ? value.replace(/\\n/g, '\\n' + indentation) : value;\n\n if (printAsMultipleLines) {\n result += '\\n';\n }\n\n return '\"\"\"' + result.replace(/\"\"\"/g, '\\\\\"\"\"') + '\"\"\"';\n}\n","/**\n * The set of allowed directive location values.\n */\nexport var DirectiveLocation = Object.freeze({\n // Request Definitions\n QUERY: 'QUERY',\n MUTATION: 'MUTATION',\n SUBSCRIPTION: 'SUBSCRIPTION',\n FIELD: 'FIELD',\n FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION',\n FRAGMENT_SPREAD: 'FRAGMENT_SPREAD',\n INLINE_FRAGMENT: 'INLINE_FRAGMENT',\n VARIABLE_DEFINITION: 'VARIABLE_DEFINITION',\n // Type System Definitions\n SCHEMA: 'SCHEMA',\n SCALAR: 'SCALAR',\n OBJECT: 'OBJECT',\n FIELD_DEFINITION: 'FIELD_DEFINITION',\n ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION',\n INTERFACE: 'INTERFACE',\n UNION: 'UNION',\n ENUM: 'ENUM',\n ENUM_VALUE: 'ENUM_VALUE',\n INPUT_OBJECT: 'INPUT_OBJECT',\n INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'\n});\n/**\n * The enum type representing the directive location values.\n */\n","/**\n * The set of allowed kind values for AST nodes.\n */\nexport var Kind = Object.freeze({\n // Name\n NAME: 'Name',\n // Document\n DOCUMENT: 'Document',\n OPERATION_DEFINITION: 'OperationDefinition',\n VARIABLE_DEFINITION: 'VariableDefinition',\n SELECTION_SET: 'SelectionSet',\n FIELD: 'Field',\n ARGUMENT: 'Argument',\n // Fragments\n FRAGMENT_SPREAD: 'FragmentSpread',\n INLINE_FRAGMENT: 'InlineFragment',\n FRAGMENT_DEFINITION: 'FragmentDefinition',\n // Values\n VARIABLE: 'Variable',\n INT: 'IntValue',\n FLOAT: 'FloatValue',\n STRING: 'StringValue',\n BOOLEAN: 'BooleanValue',\n NULL: 'NullValue',\n ENUM: 'EnumValue',\n LIST: 'ListValue',\n OBJECT: 'ObjectValue',\n OBJECT_FIELD: 'ObjectField',\n // Directives\n DIRECTIVE: 'Directive',\n // Types\n NAMED_TYPE: 'NamedType',\n LIST_TYPE: 'ListType',\n NON_NULL_TYPE: 'NonNullType',\n // Type System Definitions\n SCHEMA_DEFINITION: 'SchemaDefinition',\n OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition',\n // Type Definitions\n SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition',\n OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition',\n FIELD_DEFINITION: 'FieldDefinition',\n INPUT_VALUE_DEFINITION: 'InputValueDefinition',\n INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition',\n UNION_TYPE_DEFINITION: 'UnionTypeDefinition',\n ENUM_TYPE_DEFINITION: 'EnumTypeDefinition',\n ENUM_VALUE_DEFINITION: 'EnumValueDefinition',\n INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition',\n // Directive Definitions\n DIRECTIVE_DEFINITION: 'DirectiveDefinition',\n // Type System Extensions\n SCHEMA_EXTENSION: 'SchemaExtension',\n // Type Extensions\n SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension',\n OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension',\n INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension',\n UNION_TYPE_EXTENSION: 'UnionTypeExtension',\n ENUM_TYPE_EXTENSION: 'EnumTypeExtension',\n INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension'\n});\n/**\n * The enum type representing the possible kind values of AST nodes.\n */\n","import { GraphQLError } from \"./GraphQLError.mjs\";\n/**\n * Produces a GraphQLError representing a syntax error, containing useful\n * descriptive information about the syntax error's position in the source.\n */\n\nexport function syntaxError(source, position, description) {\n return new GraphQLError(\"Syntax Error: \".concat(description), undefined, source, [position]);\n}\n","/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nexport var TokenKind = Object.freeze({\n SOF: '',\n EOF: '',\n BANG: '!',\n DOLLAR: '$',\n AMP: '&',\n PAREN_L: '(',\n PAREN_R: ')',\n SPREAD: '...',\n COLON: ':',\n EQUALS: '=',\n AT: '@',\n BRACKET_L: '[',\n BRACKET_R: ']',\n BRACE_L: '{',\n PIPE: '|',\n BRACE_R: '}',\n NAME: 'Name',\n INT: 'Int',\n FLOAT: 'Float',\n STRING: 'String',\n BLOCK_STRING: 'BlockString',\n COMMENT: 'Comment'\n});\n/**\n * The enum type representing the token kinds values.\n */\n","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport instanceOf from \"../jsutils/instanceOf.mjs\";\n\n/**\n * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are\n * optional, but they are useful for clients who store GraphQL documents in source files.\n * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might\n * be useful for `name` to be `\"Foo.graphql\"` and location to be `{ line: 40, column: 1 }`.\n * The `line` and `column` properties in `locationOffset` are 1-indexed.\n */\nexport var Source = /*#__PURE__*/function () {\n function Source(body) {\n var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'GraphQL request';\n var locationOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n line: 1,\n column: 1\n };\n typeof body === 'string' || devAssert(0, \"Body must be a string. Received: \".concat(inspect(body), \".\"));\n this.body = body;\n this.name = name;\n this.locationOffset = locationOffset;\n this.locationOffset.line > 0 || devAssert(0, 'line in locationOffset is 1-indexed and must be positive.');\n this.locationOffset.column > 0 || devAssert(0, 'column in locationOffset is 1-indexed and must be positive.');\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n\n\n _createClass(Source, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'Source';\n }\n }]);\n\n return Source;\n}();\n/**\n * Test if the given value is a Source object.\n *\n * @internal\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isSource(source) {\n return instanceOf(source, Source);\n}\n","import { syntaxError } from \"../error/syntaxError.mjs\";\nimport { Token } from \"./ast.mjs\";\nimport { TokenKind } from \"./tokenKind.mjs\";\nimport { dedentBlockStringValue } from \"./blockString.mjs\";\n/**\n * Given a Source object, creates a Lexer for that source.\n * A Lexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\n\nexport var Lexer = /*#__PURE__*/function () {\n /**\n * The previously focused non-ignored token.\n */\n\n /**\n * The currently focused non-ignored token.\n */\n\n /**\n * The (1-indexed) line containing the current token.\n */\n\n /**\n * The character offset at which the current line begins.\n */\n function Lexer(source) {\n var startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0, null);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }\n /**\n * Advances the token stream to the next non-ignored token.\n */\n\n\n var _proto = Lexer.prototype;\n\n _proto.advance = function advance() {\n this.lastToken = this.token;\n var token = this.token = this.lookahead();\n return token;\n }\n /**\n * Looks ahead and returns the next non-ignored token, but does not change\n * the state of Lexer.\n */\n ;\n\n _proto.lookahead = function lookahead() {\n var token = this.token;\n\n if (token.kind !== TokenKind.EOF) {\n do {\n var _token$next;\n\n // Note: next is only mutable during parsing, so we cast to allow this.\n token = (_token$next = token.next) !== null && _token$next !== void 0 ? _token$next : token.next = readToken(this, token);\n } while (token.kind === TokenKind.COMMENT);\n }\n\n return token;\n };\n\n return Lexer;\n}();\n/**\n * @internal\n */\n\nexport function isPunctuatorTokenKind(kind) {\n return kind === TokenKind.BANG || kind === TokenKind.DOLLAR || kind === TokenKind.AMP || kind === TokenKind.PAREN_L || kind === TokenKind.PAREN_R || kind === TokenKind.SPREAD || kind === TokenKind.COLON || kind === TokenKind.EQUALS || kind === TokenKind.AT || kind === TokenKind.BRACKET_L || kind === TokenKind.BRACKET_R || kind === TokenKind.BRACE_L || kind === TokenKind.PIPE || kind === TokenKind.BRACE_R;\n}\n\nfunction printCharCode(code) {\n return (// NaN/undefined represents access beyond the end of the file.\n isNaN(code) ? TokenKind.EOF : // Trust JSON for ASCII.\n code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form.\n \"\\\"\\\\u\".concat(('00' + code.toString(16).toUpperCase()).slice(-4), \"\\\"\")\n );\n}\n/**\n * Gets the next token from the source starting at the given position.\n *\n * This skips over whitespace until it finds the next lexable token, then lexes\n * punctuators immediately or calls the appropriate helper function for more\n * complicated tokens.\n */\n\n\nfunction readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = prev.end;\n\n while (pos < bodyLength) {\n var code = body.charCodeAt(pos);\n var _line = lexer.line;\n\n var _col = 1 + pos - lexer.lineStart; // SourceCharacter\n\n\n switch (code) {\n case 0xfeff: // \n\n case 9: // \\t\n\n case 32: // \n\n case 44:\n // ,\n ++pos;\n continue;\n\n case 10:\n // \\n\n ++pos;\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 13:\n // \\r\n if (body.charCodeAt(pos + 1) === 10) {\n pos += 2;\n } else {\n ++pos;\n }\n\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 33:\n // !\n return new Token(TokenKind.BANG, pos, pos + 1, _line, _col, prev);\n\n case 35:\n // #\n return readComment(source, pos, _line, _col, prev);\n\n case 36:\n // $\n return new Token(TokenKind.DOLLAR, pos, pos + 1, _line, _col, prev);\n\n case 38:\n // &\n return new Token(TokenKind.AMP, pos, pos + 1, _line, _col, prev);\n\n case 40:\n // (\n return new Token(TokenKind.PAREN_L, pos, pos + 1, _line, _col, prev);\n\n case 41:\n // )\n return new Token(TokenKind.PAREN_R, pos, pos + 1, _line, _col, prev);\n\n case 46:\n // .\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Token(TokenKind.SPREAD, pos, pos + 3, _line, _col, prev);\n }\n\n break;\n\n case 58:\n // :\n return new Token(TokenKind.COLON, pos, pos + 1, _line, _col, prev);\n\n case 61:\n // =\n return new Token(TokenKind.EQUALS, pos, pos + 1, _line, _col, prev);\n\n case 64:\n // @\n return new Token(TokenKind.AT, pos, pos + 1, _line, _col, prev);\n\n case 91:\n // [\n return new Token(TokenKind.BRACKET_L, pos, pos + 1, _line, _col, prev);\n\n case 93:\n // ]\n return new Token(TokenKind.BRACKET_R, pos, pos + 1, _line, _col, prev);\n\n case 123:\n // {\n return new Token(TokenKind.BRACE_L, pos, pos + 1, _line, _col, prev);\n\n case 124:\n // |\n return new Token(TokenKind.PIPE, pos, pos + 1, _line, _col, prev);\n\n case 125:\n // }\n return new Token(TokenKind.BRACE_R, pos, pos + 1, _line, _col, prev);\n\n case 34:\n // \"\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, _line, _col, prev, lexer);\n }\n\n return readString(source, pos, _line, _col, prev);\n\n case 45: // -\n\n case 48: // 0\n\n case 49: // 1\n\n case 50: // 2\n\n case 51: // 3\n\n case 52: // 4\n\n case 53: // 5\n\n case 54: // 6\n\n case 55: // 7\n\n case 56: // 8\n\n case 57:\n // 9\n return readNumber(source, pos, code, _line, _col, prev);\n\n case 65: // A\n\n case 66: // B\n\n case 67: // C\n\n case 68: // D\n\n case 69: // E\n\n case 70: // F\n\n case 71: // G\n\n case 72: // H\n\n case 73: // I\n\n case 74: // J\n\n case 75: // K\n\n case 76: // L\n\n case 77: // M\n\n case 78: // N\n\n case 79: // O\n\n case 80: // P\n\n case 81: // Q\n\n case 82: // R\n\n case 83: // S\n\n case 84: // T\n\n case 85: // U\n\n case 86: // V\n\n case 87: // W\n\n case 88: // X\n\n case 89: // Y\n\n case 90: // Z\n\n case 95: // _\n\n case 97: // a\n\n case 98: // b\n\n case 99: // c\n\n case 100: // d\n\n case 101: // e\n\n case 102: // f\n\n case 103: // g\n\n case 104: // h\n\n case 105: // i\n\n case 106: // j\n\n case 107: // k\n\n case 108: // l\n\n case 109: // m\n\n case 110: // n\n\n case 111: // o\n\n case 112: // p\n\n case 113: // q\n\n case 114: // r\n\n case 115: // s\n\n case 116: // t\n\n case 117: // u\n\n case 118: // v\n\n case 119: // w\n\n case 120: // x\n\n case 121: // y\n\n case 122:\n // z\n return readName(source, pos, _line, _col, prev);\n }\n\n throw syntaxError(source, pos, unexpectedCharacterMessage(code));\n }\n\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n return new Token(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n}\n/**\n * Report a message that an unexpected character was encountered.\n */\n\n\nfunction unexpectedCharacterMessage(code) {\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n return \"Cannot contain the invalid character \".concat(printCharCode(code), \".\");\n }\n\n if (code === 39) {\n // '\n return 'Unexpected single quote character (\\'), did you mean to use a double quote (\")?';\n }\n\n return \"Cannot parse the unexpected character \".concat(printCharCode(code), \".\");\n}\n/**\n * Reads a comment token from the source file.\n *\n * #[\\u0009\\u0020-\\uFFFF]*\n */\n\n\nfunction readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Token(TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}\n/**\n * Reads a number token from the source file, either a float\n * or an int depending on whether a decimal point appears.\n *\n * Int: -?(0|[1-9][0-9]*)\n * Float: -?(0|[1-9][0-9]*)(\\.[0-9]+)?((E|e)(+|-)?[0-9]+)?\n */\n\n\nfunction readNumber(source, start, firstCode, line, col, prev) {\n var body = source.body;\n var code = firstCode;\n var position = start;\n var isFloat = false;\n\n if (code === 45) {\n // -\n code = body.charCodeAt(++position);\n }\n\n if (code === 48) {\n // 0\n code = body.charCodeAt(++position);\n\n if (code >= 48 && code <= 57) {\n throw syntaxError(source, position, \"Invalid number, unexpected digit after 0: \".concat(printCharCode(code), \".\"));\n }\n } else {\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n }\n\n if (code === 46) {\n // .\n isFloat = true;\n code = body.charCodeAt(++position);\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n }\n\n if (code === 69 || code === 101) {\n // E e\n isFloat = true;\n code = body.charCodeAt(++position);\n\n if (code === 43 || code === 45) {\n // + -\n code = body.charCodeAt(++position);\n }\n\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n } // Numbers cannot be followed by . or NameStart\n\n\n if (code === 46 || isNameStart(code)) {\n throw syntaxError(source, position, \"Invalid number, expected digit but got: \".concat(printCharCode(code), \".\"));\n }\n\n return new Token(isFloat ? TokenKind.FLOAT : TokenKind.INT, start, position, line, col, prev, body.slice(start, position));\n}\n/**\n * Returns the new position in the source after reading digits.\n */\n\n\nfunction readDigits(source, start, firstCode) {\n var body = source.body;\n var position = start;\n var code = firstCode;\n\n if (code >= 48 && code <= 57) {\n // 0 - 9\n do {\n code = body.charCodeAt(++position);\n } while (code >= 48 && code <= 57); // 0 - 9\n\n\n return position;\n }\n\n throw syntaxError(source, position, \"Invalid number, expected digit but got: \".concat(printCharCode(code), \".\"));\n}\n/**\n * Reads a string token from the source file.\n *\n * \"([^\"\\\\\\u000A\\u000D]|(\\\\(u[0-9a-fA-F]{4}|[\"\\\\/bfnrt])))*\"\n */\n\n\nfunction readString(source, start, line, col, prev) {\n var body = source.body;\n var position = start + 1;\n var chunkStart = position;\n var code = 0;\n var value = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position)) && // not LineTerminator\n code !== 0x000a && code !== 0x000d) {\n // Closing Quote (\")\n if (code === 34) {\n value += body.slice(chunkStart, position);\n return new Token(TokenKind.STRING, start, position + 1, line, col, prev, value);\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009) {\n throw syntaxError(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n }\n\n ++position;\n\n if (code === 92) {\n // \\\n value += body.slice(chunkStart, position - 1);\n code = body.charCodeAt(position);\n\n switch (code) {\n case 34:\n value += '\"';\n break;\n\n case 47:\n value += '/';\n break;\n\n case 92:\n value += '\\\\';\n break;\n\n case 98:\n value += '\\b';\n break;\n\n case 102:\n value += '\\f';\n break;\n\n case 110:\n value += '\\n';\n break;\n\n case 114:\n value += '\\r';\n break;\n\n case 116:\n value += '\\t';\n break;\n\n case 117:\n {\n // uXXXX\n var charCode = uniCharCode(body.charCodeAt(position + 1), body.charCodeAt(position + 2), body.charCodeAt(position + 3), body.charCodeAt(position + 4));\n\n if (charCode < 0) {\n var invalidSequence = body.slice(position + 1, position + 5);\n throw syntaxError(source, position, \"Invalid character escape sequence: \\\\u\".concat(invalidSequence, \".\"));\n }\n\n value += String.fromCharCode(charCode);\n position += 4;\n break;\n }\n\n default:\n throw syntaxError(source, position, \"Invalid character escape sequence: \\\\\".concat(String.fromCharCode(code), \".\"));\n }\n\n ++position;\n chunkStart = position;\n }\n }\n\n throw syntaxError(source, position, 'Unterminated string.');\n}\n/**\n * Reads a block string token from the source file.\n *\n * \"\"\"(\"?\"?(\\\\\"\"\"|\\\\(?!=\"\"\")|[^\"\\\\]))*\"\"\"\n */\n\n\nfunction readBlockString(source, start, line, col, prev, lexer) {\n var body = source.body;\n var position = start + 3;\n var chunkStart = position;\n var code = 0;\n var rawValue = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position))) {\n // Closing Triple-Quote (\"\"\")\n if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {\n rawValue += body.slice(chunkStart, position);\n return new Token(TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, dedentBlockStringValue(rawValue));\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw syntaxError(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n }\n\n if (code === 10) {\n // new line\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n } else if (code === 13) {\n // carriage return\n if (body.charCodeAt(position + 1) === 10) {\n position += 2;\n } else {\n ++position;\n }\n\n ++lexer.line;\n lexer.lineStart = position;\n } else if ( // Escape Triple-Quote (\\\"\"\")\n code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) {\n rawValue += body.slice(chunkStart, position) + '\"\"\"';\n position += 4;\n chunkStart = position;\n } else {\n ++position;\n }\n }\n\n throw syntaxError(source, position, 'Unterminated string.');\n}\n/**\n * Converts four hexadecimal chars to the integer that the\n * string represents. For example, uniCharCode('0','0','0','f')\n * will return 15, and uniCharCode('0','0','f','f') returns 255.\n *\n * Returns a negative number on error, if a char was invalid.\n *\n * This is implemented by noting that char2hex() returns -1 on error,\n * which means the result of ORing the char2hex() will also be negative.\n */\n\n\nfunction uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}\n/**\n * Converts a hex character to its integer value.\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 on error.\n */\n\n\nfunction char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * [_A-Za-z][_0-9A-Za-z]*\n */\n\n\nfunction readName(source, start, line, col, prev) {\n var body = source.body;\n var bodyLength = body.length;\n var position = start + 1;\n var code = 0;\n\n while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || // _\n code >= 48 && code <= 57 || // 0-9\n code >= 65 && code <= 90 || // A-Z\n code >= 97 && code <= 122) // a-z\n ) {\n ++position;\n }\n\n return new Token(TokenKind.NAME, start, position, line, col, prev, body.slice(start, position));\n} // _ A-Z a-z\n\n\nfunction isNameStart(code) {\n return code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122;\n}\n","import { syntaxError } from \"../error/syntaxError.mjs\";\nimport { Kind } from \"./kinds.mjs\";\nimport { Location } from \"./ast.mjs\";\nimport { TokenKind } from \"./tokenKind.mjs\";\nimport { Source, isSource } from \"./source.mjs\";\nimport { DirectiveLocation } from \"./directiveLocation.mjs\";\nimport { Lexer, isPunctuatorTokenKind } from \"./lexer.mjs\";\n/**\n * Configuration options to control parser behavior\n */\n\n/**\n * Given a GraphQL source, parses it into a Document.\n * Throws GraphQLError if a syntax error is encountered.\n */\nexport function parse(source, options) {\n var parser = new Parser(source, options);\n return parser.parseDocument();\n}\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: valueFromAST().\n */\n\nexport function parseValue(source, options) {\n var parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n var value = parser.parseValueLiteral(false);\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: typeFromAST().\n */\n\nexport function parseType(source, options) {\n var parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n var type = parser.parseTypeReference();\n parser.expectToken(TokenKind.EOF);\n return type;\n}\n/**\n * This class is exported only to assist people in implementing their own parsers\n * without duplicating too much code and should be used only as last resort for cases\n * such as experimental syntax or if certain features could not be contributed upstream.\n *\n * It is still part of the internal API and is versioned, so any changes to it are never\n * considered breaking changes. If you still need to support multiple versions of the\n * library, please use the `versionInfo` variable for version detection.\n *\n * @internal\n */\n\nexport var Parser = /*#__PURE__*/function () {\n function Parser(source, options) {\n var sourceObj = isSource(source) ? source : new Source(source);\n this._lexer = new Lexer(sourceObj);\n this._options = options;\n }\n /**\n * Converts a name lex token into a name parse node.\n */\n\n\n var _proto = Parser.prototype;\n\n _proto.parseName = function parseName() {\n var token = this.expectToken(TokenKind.NAME);\n return {\n kind: Kind.NAME,\n value: token.value,\n loc: this.loc(token)\n };\n } // Implements the parsing rules in the Document section.\n\n /**\n * Document : Definition+\n */\n ;\n\n _proto.parseDocument = function parseDocument() {\n var start = this._lexer.token;\n return {\n kind: Kind.DOCUMENT,\n definitions: this.many(TokenKind.SOF, this.parseDefinition, TokenKind.EOF),\n loc: this.loc(start)\n };\n }\n /**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n * - TypeSystemExtension\n *\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n */\n ;\n\n _proto.parseDefinition = function parseDefinition() {\n if (this.peek(TokenKind.NAME)) {\n switch (this._lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return this.parseOperationDefinition();\n\n case 'fragment':\n return this.parseFragmentDefinition();\n\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'directive':\n return this.parseTypeSystemDefinition();\n\n case 'extend':\n return this.parseTypeSystemExtension();\n }\n } else if (this.peek(TokenKind.BRACE_L)) {\n return this.parseOperationDefinition();\n } else if (this.peekDescription()) {\n return this.parseTypeSystemDefinition();\n }\n\n throw this.unexpected();\n } // Implements the parsing rules in the Operations section.\n\n /**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n */\n ;\n\n _proto.parseOperationDefinition = function parseOperationDefinition() {\n var start = this._lexer.token;\n\n if (this.peek(TokenKind.BRACE_L)) {\n return {\n kind: Kind.OPERATION_DEFINITION,\n operation: 'query',\n name: undefined,\n variableDefinitions: [],\n directives: [],\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n\n var operation = this.parseOperationType();\n var name;\n\n if (this.peek(TokenKind.NAME)) {\n name = this.parseName();\n }\n\n return {\n kind: Kind.OPERATION_DEFINITION,\n operation: operation,\n name: name,\n variableDefinitions: this.parseVariableDefinitions(),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * OperationType : one of query mutation subscription\n */\n ;\n\n _proto.parseOperationType = function parseOperationType() {\n var operationToken = this.expectToken(TokenKind.NAME);\n\n switch (operationToken.value) {\n case 'query':\n return 'query';\n\n case 'mutation':\n return 'mutation';\n\n case 'subscription':\n return 'subscription';\n }\n\n throw this.unexpected(operationToken);\n }\n /**\n * VariableDefinitions : ( VariableDefinition+ )\n */\n ;\n\n _proto.parseVariableDefinitions = function parseVariableDefinitions() {\n return this.optionalMany(TokenKind.PAREN_L, this.parseVariableDefinition, TokenKind.PAREN_R);\n }\n /**\n * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?\n */\n ;\n\n _proto.parseVariableDefinition = function parseVariableDefinition() {\n var start = this._lexer.token;\n return {\n kind: Kind.VARIABLE_DEFINITION,\n variable: this.parseVariable(),\n type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),\n defaultValue: this.expectOptionalToken(TokenKind.EQUALS) ? this.parseValueLiteral(true) : undefined,\n directives: this.parseDirectives(true),\n loc: this.loc(start)\n };\n }\n /**\n * Variable : $ Name\n */\n ;\n\n _proto.parseVariable = function parseVariable() {\n var start = this._lexer.token;\n this.expectToken(TokenKind.DOLLAR);\n return {\n kind: Kind.VARIABLE,\n name: this.parseName(),\n loc: this.loc(start)\n };\n }\n /**\n * SelectionSet : { Selection+ }\n */\n ;\n\n _proto.parseSelectionSet = function parseSelectionSet() {\n var start = this._lexer.token;\n return {\n kind: Kind.SELECTION_SET,\n selections: this.many(TokenKind.BRACE_L, this.parseSelection, TokenKind.BRACE_R),\n loc: this.loc(start)\n };\n }\n /**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n */\n ;\n\n _proto.parseSelection = function parseSelection() {\n return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField();\n }\n /**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n */\n ;\n\n _proto.parseField = function parseField() {\n var start = this._lexer.token;\n var nameOrAlias = this.parseName();\n var alias;\n var name;\n\n if (this.expectOptionalToken(TokenKind.COLON)) {\n alias = nameOrAlias;\n name = this.parseName();\n } else {\n name = nameOrAlias;\n }\n\n return {\n kind: Kind.FIELD,\n alias: alias,\n name: name,\n arguments: this.parseArguments(false),\n directives: this.parseDirectives(false),\n selectionSet: this.peek(TokenKind.BRACE_L) ? this.parseSelectionSet() : undefined,\n loc: this.loc(start)\n };\n }\n /**\n * Arguments[Const] : ( Argument[?Const]+ )\n */\n ;\n\n _proto.parseArguments = function parseArguments(isConst) {\n var item = isConst ? this.parseConstArgument : this.parseArgument;\n return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);\n }\n /**\n * Argument[Const] : Name : Value[?Const]\n */\n ;\n\n _proto.parseArgument = function parseArgument() {\n var start = this._lexer.token;\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return {\n kind: Kind.ARGUMENT,\n name: name,\n value: this.parseValueLiteral(false),\n loc: this.loc(start)\n };\n };\n\n _proto.parseConstArgument = function parseConstArgument() {\n var start = this._lexer.token;\n return {\n kind: Kind.ARGUMENT,\n name: this.parseName(),\n value: (this.expectToken(TokenKind.COLON), this.parseValueLiteral(true)),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Fragments section.\n\n /**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n */\n ;\n\n _proto.parseFragment = function parseFragment() {\n var start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n var hasTypeCondition = this.expectOptionalKeyword('on');\n\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n return {\n kind: Kind.FRAGMENT_SPREAD,\n name: this.parseFragmentName(),\n directives: this.parseDirectives(false),\n loc: this.loc(start)\n };\n }\n\n return {\n kind: Kind.INLINE_FRAGMENT,\n typeCondition: hasTypeCondition ? this.parseNamedType() : undefined,\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * FragmentDefinition :\n * - fragment FragmentName on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n */\n ;\n\n _proto.parseFragmentDefinition = function parseFragmentDefinition() {\n var _this$_options;\n\n var start = this._lexer.token;\n this.expectKeyword('fragment'); // Experimental support for defining variables within fragments changes\n // the grammar of FragmentDefinition:\n // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet\n\n if (((_this$_options = this._options) === null || _this$_options === void 0 ? void 0 : _this$_options.experimentalFragmentVariables) === true) {\n return {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n variableDefinitions: this.parseVariableDefinitions(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n\n return {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * FragmentName : Name but not `on`\n */\n ;\n\n _proto.parseFragmentName = function parseFragmentName() {\n if (this._lexer.token.value === 'on') {\n throw this.unexpected();\n }\n\n return this.parseName();\n } // Implements the parsing rules in the Values section.\n\n /**\n * Value[Const] :\n * - [~Const] Variable\n * - IntValue\n * - FloatValue\n * - StringValue\n * - BooleanValue\n * - NullValue\n * - EnumValue\n * - ListValue[?Const]\n * - ObjectValue[?Const]\n *\n * BooleanValue : one of `true` `false`\n *\n * NullValue : `null`\n *\n * EnumValue : Name but not `true`, `false` or `null`\n */\n ;\n\n _proto.parseValueLiteral = function parseValueLiteral(isConst) {\n var token = this._lexer.token;\n\n switch (token.kind) {\n case TokenKind.BRACKET_L:\n return this.parseList(isConst);\n\n case TokenKind.BRACE_L:\n return this.parseObject(isConst);\n\n case TokenKind.INT:\n this._lexer.advance();\n\n return {\n kind: Kind.INT,\n value: token.value,\n loc: this.loc(token)\n };\n\n case TokenKind.FLOAT:\n this._lexer.advance();\n\n return {\n kind: Kind.FLOAT,\n value: token.value,\n loc: this.loc(token)\n };\n\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n return this.parseStringLiteral();\n\n case TokenKind.NAME:\n this._lexer.advance();\n\n switch (token.value) {\n case 'true':\n return {\n kind: Kind.BOOLEAN,\n value: true,\n loc: this.loc(token)\n };\n\n case 'false':\n return {\n kind: Kind.BOOLEAN,\n value: false,\n loc: this.loc(token)\n };\n\n case 'null':\n return {\n kind: Kind.NULL,\n loc: this.loc(token)\n };\n\n default:\n return {\n kind: Kind.ENUM,\n value: token.value,\n loc: this.loc(token)\n };\n }\n\n case TokenKind.DOLLAR:\n if (!isConst) {\n return this.parseVariable();\n }\n\n break;\n }\n\n throw this.unexpected();\n };\n\n _proto.parseStringLiteral = function parseStringLiteral() {\n var token = this._lexer.token;\n\n this._lexer.advance();\n\n return {\n kind: Kind.STRING,\n value: token.value,\n block: token.kind === TokenKind.BLOCK_STRING,\n loc: this.loc(token)\n };\n }\n /**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n */\n ;\n\n _proto.parseList = function parseList(isConst) {\n var _this = this;\n\n var start = this._lexer.token;\n\n var item = function item() {\n return _this.parseValueLiteral(isConst);\n };\n\n return {\n kind: Kind.LIST,\n values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),\n loc: this.loc(start)\n };\n }\n /**\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n */\n ;\n\n _proto.parseObject = function parseObject(isConst) {\n var _this2 = this;\n\n var start = this._lexer.token;\n\n var item = function item() {\n return _this2.parseObjectField(isConst);\n };\n\n return {\n kind: Kind.OBJECT,\n fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),\n loc: this.loc(start)\n };\n }\n /**\n * ObjectField[Const] : Name : Value[?Const]\n */\n ;\n\n _proto.parseObjectField = function parseObjectField(isConst) {\n var start = this._lexer.token;\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return {\n kind: Kind.OBJECT_FIELD,\n name: name,\n value: this.parseValueLiteral(isConst),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Directives section.\n\n /**\n * Directives[Const] : Directive[?Const]+\n */\n ;\n\n _proto.parseDirectives = function parseDirectives(isConst) {\n var directives = [];\n\n while (this.peek(TokenKind.AT)) {\n directives.push(this.parseDirective(isConst));\n }\n\n return directives;\n }\n /**\n * Directive[Const] : @ Name Arguments[?Const]?\n */\n ;\n\n _proto.parseDirective = function parseDirective(isConst) {\n var start = this._lexer.token;\n this.expectToken(TokenKind.AT);\n return {\n kind: Kind.DIRECTIVE,\n name: this.parseName(),\n arguments: this.parseArguments(isConst),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Types section.\n\n /**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n */\n ;\n\n _proto.parseTypeReference = function parseTypeReference() {\n var start = this._lexer.token;\n var type;\n\n if (this.expectOptionalToken(TokenKind.BRACKET_L)) {\n type = this.parseTypeReference();\n this.expectToken(TokenKind.BRACKET_R);\n type = {\n kind: Kind.LIST_TYPE,\n type: type,\n loc: this.loc(start)\n };\n } else {\n type = this.parseNamedType();\n }\n\n if (this.expectOptionalToken(TokenKind.BANG)) {\n return {\n kind: Kind.NON_NULL_TYPE,\n type: type,\n loc: this.loc(start)\n };\n }\n\n return type;\n }\n /**\n * NamedType : Name\n */\n ;\n\n _proto.parseNamedType = function parseNamedType() {\n var start = this._lexer.token;\n return {\n kind: Kind.NAMED_TYPE,\n name: this.parseName(),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Type Definition section.\n\n /**\n * TypeSystemDefinition :\n * - SchemaDefinition\n * - TypeDefinition\n * - DirectiveDefinition\n *\n * TypeDefinition :\n * - ScalarTypeDefinition\n * - ObjectTypeDefinition\n * - InterfaceTypeDefinition\n * - UnionTypeDefinition\n * - EnumTypeDefinition\n * - InputObjectTypeDefinition\n */\n ;\n\n _proto.parseTypeSystemDefinition = function parseTypeSystemDefinition() {\n // Many definitions begin with a description and require a lookahead.\n var keywordToken = this.peekDescription() ? this._lexer.lookahead() : this._lexer.token;\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaDefinition();\n\n case 'scalar':\n return this.parseScalarTypeDefinition();\n\n case 'type':\n return this.parseObjectTypeDefinition();\n\n case 'interface':\n return this.parseInterfaceTypeDefinition();\n\n case 'union':\n return this.parseUnionTypeDefinition();\n\n case 'enum':\n return this.parseEnumTypeDefinition();\n\n case 'input':\n return this.parseInputObjectTypeDefinition();\n\n case 'directive':\n return this.parseDirectiveDefinition();\n }\n }\n\n throw this.unexpected(keywordToken);\n };\n\n _proto.peekDescription = function peekDescription() {\n return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);\n }\n /**\n * Description : StringValue\n */\n ;\n\n _proto.parseDescription = function parseDescription() {\n if (this.peekDescription()) {\n return this.parseStringLiteral();\n }\n }\n /**\n * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }\n */\n ;\n\n _proto.parseSchemaDefinition = function parseSchemaDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('schema');\n var directives = this.parseDirectives(true);\n var operationTypes = this.many(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);\n return {\n kind: Kind.SCHEMA_DEFINITION,\n description: description,\n directives: directives,\n operationTypes: operationTypes,\n loc: this.loc(start)\n };\n }\n /**\n * OperationTypeDefinition : OperationType : NamedType\n */\n ;\n\n _proto.parseOperationTypeDefinition = function parseOperationTypeDefinition() {\n var start = this._lexer.token;\n var operation = this.parseOperationType();\n this.expectToken(TokenKind.COLON);\n var type = this.parseNamedType();\n return {\n kind: Kind.OPERATION_TYPE_DEFINITION,\n operation: operation,\n type: type,\n loc: this.loc(start)\n };\n }\n /**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n */\n ;\n\n _proto.parseScalarTypeDefinition = function parseScalarTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('scalar');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.SCALAR_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n */\n ;\n\n _proto.parseObjectTypeDefinition = function parseObjectTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('type');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n return {\n kind: Kind.OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * ImplementsInterfaces :\n * - implements `&`? NamedType\n * - ImplementsInterfaces & NamedType\n */\n ;\n\n _proto.parseImplementsInterfaces = function parseImplementsInterfaces() {\n var _this$_options2;\n\n if (!this.expectOptionalKeyword('implements')) {\n return [];\n }\n\n if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {\n var types = []; // Optional leading ampersand\n\n this.expectOptionalToken(TokenKind.AMP);\n\n do {\n types.push(this.parseNamedType());\n } while (this.expectOptionalToken(TokenKind.AMP) || this.peek(TokenKind.NAME));\n\n return types;\n }\n\n return this.delimitedMany(TokenKind.AMP, this.parseNamedType);\n }\n /**\n * FieldsDefinition : { FieldDefinition+ }\n */\n ;\n\n _proto.parseFieldsDefinition = function parseFieldsDefinition() {\n var _this$_options3;\n\n // Legacy support for the SDL?\n if (((_this$_options3 = this._options) === null || _this$_options3 === void 0 ? void 0 : _this$_options3.allowLegacySDLEmptyFields) === true && this.peek(TokenKind.BRACE_L) && this._lexer.lookahead().kind === TokenKind.BRACE_R) {\n this._lexer.advance();\n\n this._lexer.advance();\n\n return [];\n }\n\n return this.optionalMany(TokenKind.BRACE_L, this.parseFieldDefinition, TokenKind.BRACE_R);\n }\n /**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n */\n ;\n\n _proto.parseFieldDefinition = function parseFieldDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n var args = this.parseArgumentDefs();\n this.expectToken(TokenKind.COLON);\n var type = this.parseTypeReference();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.FIELD_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n */\n ;\n\n _proto.parseArgumentDefs = function parseArgumentDefs() {\n return this.optionalMany(TokenKind.PAREN_L, this.parseInputValueDef, TokenKind.PAREN_R);\n }\n /**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n */\n ;\n\n _proto.parseInputValueDef = function parseInputValueDef() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n var type = this.parseTypeReference();\n var defaultValue;\n\n if (this.expectOptionalToken(TokenKind.EQUALS)) {\n defaultValue = this.parseValueLiteral(true);\n }\n\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.INPUT_VALUE_DEFINITION,\n description: description,\n name: name,\n type: type,\n defaultValue: defaultValue,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n */\n ;\n\n _proto.parseInterfaceTypeDefinition = function parseInterfaceTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('interface');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n return {\n kind: Kind.INTERFACE_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? UnionMemberTypes?\n */\n ;\n\n _proto.parseUnionTypeDefinition = function parseUnionTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('union');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var types = this.parseUnionMemberTypes();\n return {\n kind: Kind.UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: this.loc(start)\n };\n }\n /**\n * UnionMemberTypes :\n * - = `|`? NamedType\n * - UnionMemberTypes | NamedType\n */\n ;\n\n _proto.parseUnionMemberTypes = function parseUnionMemberTypes() {\n return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : [];\n }\n /**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n */\n ;\n\n _proto.parseEnumTypeDefinition = function parseEnumTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('enum');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var values = this.parseEnumValuesDefinition();\n return {\n kind: Kind.ENUM_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n values: values,\n loc: this.loc(start)\n };\n }\n /**\n * EnumValuesDefinition : { EnumValueDefinition+ }\n */\n ;\n\n _proto.parseEnumValuesDefinition = function parseEnumValuesDefinition() {\n return this.optionalMany(TokenKind.BRACE_L, this.parseEnumValueDefinition, TokenKind.BRACE_R);\n }\n /**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n *\n * EnumValue : Name\n */\n ;\n\n _proto.parseEnumValueDefinition = function parseEnumValueDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.ENUM_VALUE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n */\n ;\n\n _proto.parseInputObjectTypeDefinition = function parseInputObjectTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('input');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var fields = this.parseInputFieldsDefinition();\n return {\n kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * InputFieldsDefinition : { InputValueDefinition+ }\n */\n ;\n\n _proto.parseInputFieldsDefinition = function parseInputFieldsDefinition() {\n return this.optionalMany(TokenKind.BRACE_L, this.parseInputValueDef, TokenKind.BRACE_R);\n }\n /**\n * TypeSystemExtension :\n * - SchemaExtension\n * - TypeExtension\n *\n * TypeExtension :\n * - ScalarTypeExtension\n * - ObjectTypeExtension\n * - InterfaceTypeExtension\n * - UnionTypeExtension\n * - EnumTypeExtension\n * - InputObjectTypeDefinition\n */\n ;\n\n _proto.parseTypeSystemExtension = function parseTypeSystemExtension() {\n var keywordToken = this._lexer.lookahead();\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaExtension();\n\n case 'scalar':\n return this.parseScalarTypeExtension();\n\n case 'type':\n return this.parseObjectTypeExtension();\n\n case 'interface':\n return this.parseInterfaceTypeExtension();\n\n case 'union':\n return this.parseUnionTypeExtension();\n\n case 'enum':\n return this.parseEnumTypeExtension();\n\n case 'input':\n return this.parseInputObjectTypeExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n }\n /**\n * SchemaExtension :\n * - extend schema Directives[Const]? { OperationTypeDefinition+ }\n * - extend schema Directives[Const]\n */\n ;\n\n _proto.parseSchemaExtension = function parseSchemaExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('schema');\n var directives = this.parseDirectives(true);\n var operationTypes = this.optionalMany(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);\n\n if (directives.length === 0 && operationTypes.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.SCHEMA_EXTENSION,\n directives: directives,\n operationTypes: operationTypes,\n loc: this.loc(start)\n };\n }\n /**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n */\n ;\n\n _proto.parseScalarTypeExtension = function parseScalarTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('scalar');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n\n if (directives.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.SCALAR_TYPE_EXTENSION,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ObjectTypeExtension :\n * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend type Name ImplementsInterfaces? Directives[Const]\n * - extend type Name ImplementsInterfaces\n */\n ;\n\n _proto.parseObjectTypeExtension = function parseObjectTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('type');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * InterfaceTypeExtension :\n * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend interface Name ImplementsInterfaces? Directives[Const]\n * - extend interface Name ImplementsInterfaces\n */\n ;\n\n _proto.parseInterfaceTypeExtension = function parseInterfaceTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('interface');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.INTERFACE_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? UnionMemberTypes\n * - extend union Name Directives[Const]\n */\n ;\n\n _proto.parseUnionTypeExtension = function parseUnionTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('union');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var types = this.parseUnionMemberTypes();\n\n if (directives.length === 0 && types.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: this.loc(start)\n };\n }\n /**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n */\n ;\n\n _proto.parseEnumTypeExtension = function parseEnumTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('enum');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var values = this.parseEnumValuesDefinition();\n\n if (directives.length === 0 && values.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: this.loc(start)\n };\n }\n /**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n */\n ;\n\n _proto.parseInputObjectTypeExtension = function parseInputObjectTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('input');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var fields = this.parseInputFieldsDefinition();\n\n if (directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations\n */\n ;\n\n _proto.parseDirectiveDefinition = function parseDirectiveDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('directive');\n this.expectToken(TokenKind.AT);\n var name = this.parseName();\n var args = this.parseArgumentDefs();\n var repeatable = this.expectOptionalKeyword('repeatable');\n this.expectKeyword('on');\n var locations = this.parseDirectiveLocations();\n return {\n kind: Kind.DIRECTIVE_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n repeatable: repeatable,\n locations: locations,\n loc: this.loc(start)\n };\n }\n /**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n */\n ;\n\n _proto.parseDirectiveLocations = function parseDirectiveLocations() {\n return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);\n }\n /*\n * DirectiveLocation :\n * - ExecutableDirectiveLocation\n * - TypeSystemDirectiveLocation\n *\n * ExecutableDirectiveLocation : one of\n * `QUERY`\n * `MUTATION`\n * `SUBSCRIPTION`\n * `FIELD`\n * `FRAGMENT_DEFINITION`\n * `FRAGMENT_SPREAD`\n * `INLINE_FRAGMENT`\n *\n * TypeSystemDirectiveLocation : one of\n * `SCHEMA`\n * `SCALAR`\n * `OBJECT`\n * `FIELD_DEFINITION`\n * `ARGUMENT_DEFINITION`\n * `INTERFACE`\n * `UNION`\n * `ENUM`\n * `ENUM_VALUE`\n * `INPUT_OBJECT`\n * `INPUT_FIELD_DEFINITION`\n */\n ;\n\n _proto.parseDirectiveLocation = function parseDirectiveLocation() {\n var start = this._lexer.token;\n var name = this.parseName();\n\n if (DirectiveLocation[name.value] !== undefined) {\n return name;\n }\n\n throw this.unexpected(start);\n } // Core parsing utility functions\n\n /**\n * Returns a location object, used to identify the place in the source that created a given parsed object.\n */\n ;\n\n _proto.loc = function loc(startToken) {\n var _this$_options4;\n\n if (((_this$_options4 = this._options) === null || _this$_options4 === void 0 ? void 0 : _this$_options4.noLocation) !== true) {\n return new Location(startToken, this._lexer.lastToken, this._lexer.source);\n }\n }\n /**\n * Determines if the next token is of a given kind\n */\n ;\n\n _proto.peek = function peek(kind) {\n return this._lexer.token.kind === kind;\n }\n /**\n * If the next token is of the given kind, return that token after advancing the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n ;\n\n _proto.expectToken = function expectToken(kind) {\n var token = this._lexer.token;\n\n if (token.kind === kind) {\n this._lexer.advance();\n\n return token;\n }\n\n throw syntaxError(this._lexer.source, token.start, \"Expected \".concat(getTokenKindDesc(kind), \", found \").concat(getTokenDesc(token), \".\"));\n }\n /**\n * If the next token is of the given kind, return that token after advancing the lexer.\n * Otherwise, do not change the parser state and return undefined.\n */\n ;\n\n _proto.expectOptionalToken = function expectOptionalToken(kind) {\n var token = this._lexer.token;\n\n if (token.kind === kind) {\n this._lexer.advance();\n\n return token;\n }\n\n return undefined;\n }\n /**\n * If the next token is a given keyword, advance the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n ;\n\n _proto.expectKeyword = function expectKeyword(value) {\n var token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this._lexer.advance();\n } else {\n throw syntaxError(this._lexer.source, token.start, \"Expected \\\"\".concat(value, \"\\\", found \").concat(getTokenDesc(token), \".\"));\n }\n }\n /**\n * If the next token is a given keyword, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n */\n ;\n\n _proto.expectOptionalKeyword = function expectOptionalKeyword(value) {\n var token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this._lexer.advance();\n\n return true;\n }\n\n return false;\n }\n /**\n * Helper function for creating an error when an unexpected lexed token is encountered.\n */\n ;\n\n _proto.unexpected = function unexpected(atToken) {\n var token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;\n return syntaxError(this._lexer.source, token.start, \"Unexpected \".concat(getTokenDesc(token), \".\"));\n }\n /**\n * Returns a possibly empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n ;\n\n _proto.any = function any(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n var nodes = [];\n\n while (!this.expectOptionalToken(closeKind)) {\n nodes.push(parseFn.call(this));\n }\n\n return nodes;\n }\n /**\n * Returns a list of parse nodes, determined by the parseFn.\n * It can be empty only if open token is missing otherwise it will always return non-empty list\n * that begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n ;\n\n _proto.optionalMany = function optionalMany(openKind, parseFn, closeKind) {\n if (this.expectOptionalToken(openKind)) {\n var nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n\n return [];\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n ;\n\n _proto.many = function many(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n var nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.\n * Advances the parser to the next lex token after last item in the list.\n */\n ;\n\n _proto.delimitedMany = function delimitedMany(delimiterKind, parseFn) {\n this.expectOptionalToken(delimiterKind);\n var nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (this.expectOptionalToken(delimiterKind));\n\n return nodes;\n };\n\n return Parser;\n}();\n/**\n * A helper function to describe a token as a string for debugging.\n */\n\nfunction getTokenDesc(token) {\n var value = token.value;\n return getTokenKindDesc(token.kind) + (value != null ? \" \\\"\".concat(value, \"\\\"\") : '');\n}\n/**\n * A helper function to describe a token kind as a string for debugging.\n */\n\n\nfunction getTokenKindDesc(kind) {\n return isPunctuatorTokenKind(kind) ? \"\\\"\".concat(kind, \"\\\"\") : kind;\n}\n","import { visit } from \"./visitor.mjs\";\nimport { printBlockString } from \"./blockString.mjs\";\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n */\n\nexport function print(ast) {\n return visit(ast, {\n leave: printDocASTReducer\n });\n}\nvar MAX_LINE_LENGTH = 80; // TODO: provide better type coverage in future\n\nvar printDocASTReducer = {\n Name: function Name(node) {\n return node.value;\n },\n Variable: function Variable(node) {\n return '$' + node.name;\n },\n // Document\n Document: function Document(node) {\n return join(node.definitions, '\\n\\n') + '\\n';\n },\n OperationDefinition: function OperationDefinition(node) {\n var op = node.operation;\n var name = node.name;\n var varDefs = wrap('(', join(node.variableDefinitions, ', '), ')');\n var directives = join(node.directives, ' ');\n var selectionSet = node.selectionSet; // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n\n return !name && !directives && !varDefs && op === 'query' ? selectionSet : join([op, join([name, varDefs]), directives, selectionSet], ' ');\n },\n VariableDefinition: function VariableDefinition(_ref) {\n var variable = _ref.variable,\n type = _ref.type,\n defaultValue = _ref.defaultValue,\n directives = _ref.directives;\n return variable + ': ' + type + wrap(' = ', defaultValue) + wrap(' ', join(directives, ' '));\n },\n SelectionSet: function SelectionSet(_ref2) {\n var selections = _ref2.selections;\n return block(selections);\n },\n Field: function Field(_ref3) {\n var alias = _ref3.alias,\n name = _ref3.name,\n args = _ref3.arguments,\n directives = _ref3.directives,\n selectionSet = _ref3.selectionSet;\n var prefix = wrap('', alias, ': ') + name;\n var argsLine = prefix + wrap('(', join(args, ', '), ')');\n\n if (argsLine.length > MAX_LINE_LENGTH) {\n argsLine = prefix + wrap('(\\n', indent(join(args, '\\n')), '\\n)');\n }\n\n return join([argsLine, join(directives, ' '), selectionSet], ' ');\n },\n Argument: function Argument(_ref4) {\n var name = _ref4.name,\n value = _ref4.value;\n return name + ': ' + value;\n },\n // Fragments\n FragmentSpread: function FragmentSpread(_ref5) {\n var name = _ref5.name,\n directives = _ref5.directives;\n return '...' + name + wrap(' ', join(directives, ' '));\n },\n InlineFragment: function InlineFragment(_ref6) {\n var typeCondition = _ref6.typeCondition,\n directives = _ref6.directives,\n selectionSet = _ref6.selectionSet;\n return join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' ');\n },\n FragmentDefinition: function FragmentDefinition(_ref7) {\n var name = _ref7.name,\n typeCondition = _ref7.typeCondition,\n variableDefinitions = _ref7.variableDefinitions,\n directives = _ref7.directives,\n selectionSet = _ref7.selectionSet;\n return (// Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n \"fragment \".concat(name).concat(wrap('(', join(variableDefinitions, ', '), ')'), \" \") + \"on \".concat(typeCondition, \" \").concat(wrap('', join(directives, ' '), ' ')) + selectionSet\n );\n },\n // Value\n IntValue: function IntValue(_ref8) {\n var value = _ref8.value;\n return value;\n },\n FloatValue: function FloatValue(_ref9) {\n var value = _ref9.value;\n return value;\n },\n StringValue: function StringValue(_ref10, key) {\n var value = _ref10.value,\n isBlockString = _ref10.block;\n return isBlockString ? printBlockString(value, key === 'description' ? '' : ' ') : JSON.stringify(value);\n },\n BooleanValue: function BooleanValue(_ref11) {\n var value = _ref11.value;\n return value ? 'true' : 'false';\n },\n NullValue: function NullValue() {\n return 'null';\n },\n EnumValue: function EnumValue(_ref12) {\n var value = _ref12.value;\n return value;\n },\n ListValue: function ListValue(_ref13) {\n var values = _ref13.values;\n return '[' + join(values, ', ') + ']';\n },\n ObjectValue: function ObjectValue(_ref14) {\n var fields = _ref14.fields;\n return '{' + join(fields, ', ') + '}';\n },\n ObjectField: function ObjectField(_ref15) {\n var name = _ref15.name,\n value = _ref15.value;\n return name + ': ' + value;\n },\n // Directive\n Directive: function Directive(_ref16) {\n var name = _ref16.name,\n args = _ref16.arguments;\n return '@' + name + wrap('(', join(args, ', '), ')');\n },\n // Type\n NamedType: function NamedType(_ref17) {\n var name = _ref17.name;\n return name;\n },\n ListType: function ListType(_ref18) {\n var type = _ref18.type;\n return '[' + type + ']';\n },\n NonNullType: function NonNullType(_ref19) {\n var type = _ref19.type;\n return type + '!';\n },\n // Type System Definitions\n SchemaDefinition: addDescription(function (_ref20) {\n var directives = _ref20.directives,\n operationTypes = _ref20.operationTypes;\n return join(['schema', join(directives, ' '), block(operationTypes)], ' ');\n }),\n OperationTypeDefinition: function OperationTypeDefinition(_ref21) {\n var operation = _ref21.operation,\n type = _ref21.type;\n return operation + ': ' + type;\n },\n ScalarTypeDefinition: addDescription(function (_ref22) {\n var name = _ref22.name,\n directives = _ref22.directives;\n return join(['scalar', name, join(directives, ' ')], ' ');\n }),\n ObjectTypeDefinition: addDescription(function (_ref23) {\n var name = _ref23.name,\n interfaces = _ref23.interfaces,\n directives = _ref23.directives,\n fields = _ref23.fields;\n return join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n }),\n FieldDefinition: addDescription(function (_ref24) {\n var name = _ref24.name,\n args = _ref24.arguments,\n type = _ref24.type,\n directives = _ref24.directives;\n return name + (hasMultilineItems(args) ? wrap('(\\n', indent(join(args, '\\n')), '\\n)') : wrap('(', join(args, ', '), ')')) + ': ' + type + wrap(' ', join(directives, ' '));\n }),\n InputValueDefinition: addDescription(function (_ref25) {\n var name = _ref25.name,\n type = _ref25.type,\n defaultValue = _ref25.defaultValue,\n directives = _ref25.directives;\n return join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' ');\n }),\n InterfaceTypeDefinition: addDescription(function (_ref26) {\n var name = _ref26.name,\n interfaces = _ref26.interfaces,\n directives = _ref26.directives,\n fields = _ref26.fields;\n return join(['interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n }),\n UnionTypeDefinition: addDescription(function (_ref27) {\n var name = _ref27.name,\n directives = _ref27.directives,\n types = _ref27.types;\n return join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n }),\n EnumTypeDefinition: addDescription(function (_ref28) {\n var name = _ref28.name,\n directives = _ref28.directives,\n values = _ref28.values;\n return join(['enum', name, join(directives, ' '), block(values)], ' ');\n }),\n EnumValueDefinition: addDescription(function (_ref29) {\n var name = _ref29.name,\n directives = _ref29.directives;\n return join([name, join(directives, ' ')], ' ');\n }),\n InputObjectTypeDefinition: addDescription(function (_ref30) {\n var name = _ref30.name,\n directives = _ref30.directives,\n fields = _ref30.fields;\n return join(['input', name, join(directives, ' '), block(fields)], ' ');\n }),\n DirectiveDefinition: addDescription(function (_ref31) {\n var name = _ref31.name,\n args = _ref31.arguments,\n repeatable = _ref31.repeatable,\n locations = _ref31.locations;\n return 'directive @' + name + (hasMultilineItems(args) ? wrap('(\\n', indent(join(args, '\\n')), '\\n)') : wrap('(', join(args, ', '), ')')) + (repeatable ? ' repeatable' : '') + ' on ' + join(locations, ' | ');\n }),\n SchemaExtension: function SchemaExtension(_ref32) {\n var directives = _ref32.directives,\n operationTypes = _ref32.operationTypes;\n return join(['extend schema', join(directives, ' '), block(operationTypes)], ' ');\n },\n ScalarTypeExtension: function ScalarTypeExtension(_ref33) {\n var name = _ref33.name,\n directives = _ref33.directives;\n return join(['extend scalar', name, join(directives, ' ')], ' ');\n },\n ObjectTypeExtension: function ObjectTypeExtension(_ref34) {\n var name = _ref34.name,\n interfaces = _ref34.interfaces,\n directives = _ref34.directives,\n fields = _ref34.fields;\n return join(['extend type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n },\n InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) {\n var name = _ref35.name,\n interfaces = _ref35.interfaces,\n directives = _ref35.directives,\n fields = _ref35.fields;\n return join(['extend interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');\n },\n UnionTypeExtension: function UnionTypeExtension(_ref36) {\n var name = _ref36.name,\n directives = _ref36.directives,\n types = _ref36.types;\n return join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');\n },\n EnumTypeExtension: function EnumTypeExtension(_ref37) {\n var name = _ref37.name,\n directives = _ref37.directives,\n values = _ref37.values;\n return join(['extend enum', name, join(directives, ' '), block(values)], ' ');\n },\n InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) {\n var name = _ref38.name,\n directives = _ref38.directives,\n fields = _ref38.fields;\n return join(['extend input', name, join(directives, ' '), block(fields)], ' ');\n }\n};\n\nfunction addDescription(cb) {\n return function (node) {\n return join([node.description, cb(node)], '\\n');\n };\n}\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n */\n\n\nfunction join(maybeArray) {\n var _maybeArray$filter$jo;\n\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {\n return x;\n }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';\n}\n/**\n * Given array, print each item on its own line, wrapped in an\n * indented \"{ }\" block.\n */\n\n\nfunction block(array) {\n return wrap('{\\n', indent(join(array, '\\n')), '\\n}');\n}\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.\n */\n\n\nfunction wrap(start, maybeString) {\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n return maybeString != null && maybeString !== '' ? start + maybeString + end : '';\n}\n\nfunction indent(str) {\n return wrap(' ', str.replace(/\\n/g, '\\n '));\n}\n\nfunction isMultiline(str) {\n return str.indexOf('\\n') !== -1;\n}\n\nfunction hasMultilineItems(maybeArray) {\n return maybeArray != null && maybeArray.some(isMultiline);\n}\n","import inspect from \"../jsutils/inspect.mjs\";\nimport { isNode } from \"./ast.mjs\";\n/**\n * A visitor is provided to visit, it contains the collection of\n * relevant functions to be called during the visitor's traversal.\n */\n\nexport var QueryDocumentKeys = {\n Name: [],\n Document: ['definitions'],\n OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'],\n VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'],\n Variable: ['name'],\n SelectionSet: ['selections'],\n Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],\n Argument: ['name', 'value'],\n FragmentSpread: ['name', 'directives'],\n InlineFragment: ['typeCondition', 'directives', 'selectionSet'],\n FragmentDefinition: ['name', // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n 'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'],\n IntValue: [],\n FloatValue: [],\n StringValue: [],\n BooleanValue: [],\n NullValue: [],\n EnumValue: [],\n ListValue: ['values'],\n ObjectValue: ['fields'],\n ObjectField: ['name', 'value'],\n Directive: ['name', 'arguments'],\n NamedType: ['name'],\n ListType: ['type'],\n NonNullType: ['type'],\n SchemaDefinition: ['description', 'directives', 'operationTypes'],\n OperationTypeDefinition: ['type'],\n ScalarTypeDefinition: ['description', 'name', 'directives'],\n ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],\n FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],\n InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'],\n InterfaceTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],\n UnionTypeDefinition: ['description', 'name', 'directives', 'types'],\n EnumTypeDefinition: ['description', 'name', 'directives', 'values'],\n EnumValueDefinition: ['description', 'name', 'directives'],\n InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],\n DirectiveDefinition: ['description', 'name', 'arguments', 'locations'],\n SchemaExtension: ['directives', 'operationTypes'],\n ScalarTypeExtension: ['name', 'directives'],\n ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n UnionTypeExtension: ['name', 'directives', 'types'],\n EnumTypeExtension: ['name', 'directives', 'values'],\n InputObjectTypeExtension: ['name', 'directives', 'fields']\n};\nexport var BREAK = Object.freeze({});\n/**\n * visit() will walk through an AST using a depth-first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n *\n * const editedAST = visit(ast, {\n * enter(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: skip visiting this node\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * },\n * leave(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: no action\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * }\n * });\n *\n * Alternatively to providing enter() and leave() functions, a visitor can\n * instead provide functions named the same as the kinds of AST nodes, or\n * enter/leave visitors at a named key, leading to four permutations of the\n * visitor API:\n *\n * 1) Named visitors triggered when entering a node of a specific kind.\n *\n * visit(ast, {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * })\n *\n * 2) Named visitors that trigger upon entering and leaving a node of\n * a specific kind.\n *\n * visit(ast, {\n * Kind: {\n * enter(node) {\n * // enter the \"Kind\" node\n * }\n * leave(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n *\n * 3) Generic visitors that trigger upon entering and leaving any node.\n *\n * visit(ast, {\n * enter(node) {\n * // enter any node\n * },\n * leave(node) {\n * // leave any node\n * }\n * })\n *\n * 4) Parallel visitors for entering and leaving nodes of a specific kind.\n *\n * visit(ast, {\n * enter: {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * },\n * leave: {\n * Kind(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n */\n\nexport function visit(root, visitor) {\n var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys;\n\n /* eslint-disable no-undef-init */\n var stack = undefined;\n var inArray = Array.isArray(root);\n var keys = [root];\n var index = -1;\n var edits = [];\n var node = undefined;\n var key = undefined;\n var parent = undefined;\n var path = [];\n var ancestors = [];\n var newRoot = root;\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n var isLeaving = index === keys.length;\n var isEdited = isLeaving && edits.length !== 0;\n\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n } else {\n var clone = {};\n\n for (var _i2 = 0, _Object$keys2 = Object.keys(node); _i2 < _Object$keys2.length; _i2++) {\n var k = _Object$keys2[_i2];\n clone[k] = node[k];\n }\n\n node = clone;\n }\n\n var editOffset = 0;\n\n for (var ii = 0; ii < edits.length; ii++) {\n var editKey = edits[ii][0];\n var editValue = edits[ii][1];\n\n if (inArray) {\n editKey -= editOffset;\n }\n\n if (inArray && editValue === null) {\n node.splice(editKey, 1);\n editOffset++;\n } else {\n node[editKey] = editValue;\n }\n }\n }\n\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else {\n key = parent ? inArray ? index : keys[index] : undefined;\n node = parent ? parent[key] : newRoot;\n\n if (node === null || node === undefined) {\n continue;\n }\n\n if (parent) {\n path.push(key);\n }\n }\n\n var result = void 0;\n\n if (!Array.isArray(node)) {\n if (!isNode(node)) {\n throw new Error(\"Invalid AST Node: \".concat(inspect(node), \".\"));\n }\n\n var visitFn = getVisitFn(visitor, node.kind, isLeaving);\n\n if (visitFn) {\n result = visitFn.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n var _visitorKeys$node$kin;\n\n stack = {\n inArray: inArray,\n index: index,\n keys: keys,\n edits: edits,\n prev: stack\n };\n inArray = Array.isArray(node);\n keys = inArray ? node : (_visitorKeys$node$kin = visitorKeys[node.kind]) !== null && _visitorKeys$node$kin !== void 0 ? _visitorKeys$node$kin : [];\n index = -1;\n edits = [];\n\n if (parent) {\n ancestors.push(parent);\n }\n\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n newRoot = edits[edits.length - 1][1];\n }\n\n return newRoot;\n}\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n */\n\nexport function visitInParallel(visitors) {\n var skipping = new Array(visitors.length);\n return {\n enter: function enter(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n }\n },\n leave: function leave(node) {\n for (var i = 0; i < visitors.length; i++) {\n if (skipping[i] == null) {\n var fn = getVisitFn(visitors[i], node.kind,\n /* isLeaving */\n true);\n\n if (fn) {\n var result = fn.apply(visitors[i], arguments);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n }\n };\n}\n/**\n * Given a visitor instance, if it is leaving or not, and a node kind, return\n * the function the visitor runtime should call.\n */\n\nexport function getVisitFn(visitor, kind, isLeaving) {\n var kindVisitor = visitor[kind];\n\n if (kindVisitor) {\n if (!isLeaving && typeof kindVisitor === 'function') {\n // { Kind() {} }\n return kindVisitor;\n }\n\n var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter;\n\n if (typeof kindSpecificVisitor === 'function') {\n // { Kind: { enter() {}, leave() {} } }\n return kindSpecificVisitor;\n }\n } else {\n var specificVisitor = isLeaving ? visitor.leave : visitor.enter;\n\n if (specificVisitor) {\n if (typeof specificVisitor === 'function') {\n // { enter() {}, leave() {} }\n return specificVisitor;\n }\n\n var specificKindVisitor = specificVisitor[kind];\n\n if (typeof specificKindVisitor === 'function') {\n // { enter: { Kind() {} }, leave: { Kind() {} } }\n return specificKindVisitor;\n }\n }\n }\n}\n","import { SYMBOL_ITERATOR } from \"./symbols.mjs\";\n\n/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound]\nvar arrayFrom = Array.from || function (obj, mapFn, thisArg) {\n if (obj == null) {\n throw new TypeError('Array.from requires an array-like object - not null or undefined');\n } // Is Iterable?\n\n\n var iteratorMethod = obj[SYMBOL_ITERATOR];\n\n if (typeof iteratorMethod === 'function') {\n var iterator = iteratorMethod.call(obj);\n var result = [];\n var step;\n\n for (var i = 0; !(step = iterator.next()).done; ++i) {\n result.push(mapFn.call(thisArg, step.value, i)); // Infinite Iterators could cause forEach to run forever.\n // After a very large number of iterations, produce an error.\n // istanbul ignore if (Too big to actually test)\n\n if (i > 9999999) {\n throw new TypeError('Near-infinite iteration.');\n }\n }\n\n return result;\n } // Is Array like?\n\n\n var length = obj.length;\n\n if (typeof length === 'number' && length >= 0 && length % 1 === 0) {\n var _result = [];\n\n for (var _i = 0; _i < length; ++_i) {\n if (Object.prototype.hasOwnProperty.call(obj, _i)) {\n _result.push(mapFn.call(thisArg, obj[_i], _i));\n }\n }\n\n return _result;\n }\n\n return [];\n};\n\nexport default arrayFrom;\n","/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound]\nvar find = Array.prototype.find ? function (list, predicate) {\n return Array.prototype.find.call(list, predicate);\n} : function (list, predicate) {\n for (var _i2 = 0; _i2 < list.length; _i2++) {\n var value = list[_i2];\n\n if (predicate(value)) {\n return value;\n }\n }\n};\nexport default find;\n","/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441\nvar isFinitePolyfill = Number.isFinite || function (value) {\n return typeof value === 'number' && isFinite(value);\n};\n\nexport default isFinitePolyfill;\n","/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441\nvar objectEntries = Object.entries || function (obj) {\n return Object.keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n};\n\nexport default objectEntries;\n","/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441\nvar objectValues = Object.values || function (obj) {\n return Object.keys(obj).map(function (key) {\n return obj[key];\n });\n};\n\nexport default objectValues;\n","// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator\n// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\nexport var SYMBOL_ITERATOR = typeof Symbol === 'function' && Symbol.iterator != null ? Symbol.iterator : '@@iterator'; // In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator\n// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\nexport var SYMBOL_ASYNC_ITERATOR = typeof Symbol === 'function' && Symbol.asyncIterator != null ? Symbol.asyncIterator : '@@asyncIterator'; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\nexport var SYMBOL_TO_STRING_TAG = typeof Symbol === 'function' && Symbol.toStringTag != null ? Symbol.toStringTag : '@@toStringTag';\n","import objectEntries from \"../polyfills/objectEntries.mjs\";\n\n/**\n * Creates an object map with the same keys as `map` and values generated by\n * running each value of `map` thru `fn`.\n */\nexport default function mapValue(map, fn) {\n var result = Object.create(null);\n\n for (var _i2 = 0, _objectEntries2 = objectEntries(map); _i2 < _objectEntries2.length; _i2++) {\n var _ref2 = _objectEntries2[_i2];\n var _key = _ref2[0];\n var _value = _ref2[1];\n result[_key] = fn(_value, _key);\n }\n\n return result;\n}\n","/**\n * Returns the first argument it receives.\n */\nexport default function identityFunc(x) {\n return x;\n}\n","import inspect from \"../jsutils/inspect.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport keyValMap from \"../jsutils/keyValMap.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\n\n/**\n * Produces a JavaScript value given a GraphQL Value AST.\n *\n * Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value\n * will reflect the provided GraphQL value AST.\n *\n * | GraphQL Value | JavaScript Value |\n * | -------------------- | ---------------- |\n * | Input Object | Object |\n * | List | Array |\n * | Boolean | Boolean |\n * | String / Enum | String |\n * | Int / Float | Number |\n * | Null | null |\n *\n */\nexport function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case Kind.NULL:\n return null;\n\n case Kind.INT:\n return parseInt(valueNode.value, 10);\n\n case Kind.FLOAT:\n return parseFloat(valueNode.value);\n\n case Kind.STRING:\n case Kind.ENUM:\n case Kind.BOOLEAN:\n return valueNode.value;\n\n case Kind.LIST:\n return valueNode.values.map(function (node) {\n return valueFromASTUntyped(node, variables);\n });\n\n case Kind.OBJECT:\n return keyValMap(valueNode.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return valueFromASTUntyped(field.value, variables);\n });\n\n case Kind.VARIABLE:\n return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value];\n } // istanbul ignore next (Not reachable. All possible value nodes have been considered)\n\n\n false || invariant(0, 'Unexpected value node: ' + inspect(valueNode));\n}\n","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport objectEntries from \"../polyfills/objectEntries.mjs\";\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport keyMap from \"../jsutils/keyMap.mjs\";\nimport mapValue from \"../jsutils/mapValue.mjs\";\nimport toObjMap from \"../jsutils/toObjMap.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport keyValMap from \"../jsutils/keyValMap.mjs\";\nimport instanceOf from \"../jsutils/instanceOf.mjs\";\nimport didYouMean from \"../jsutils/didYouMean.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport identityFunc from \"../jsutils/identityFunc.mjs\";\nimport defineInspect from \"../jsutils/defineInspect.mjs\";\nimport suggestionList from \"../jsutils/suggestionList.mjs\";\nimport { GraphQLError } from \"../error/GraphQLError.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { print } from \"../language/printer.mjs\";\nimport { valueFromASTUntyped } from \"../utilities/valueFromASTUntyped.mjs\";\nexport function isType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type) || isListType(type) || isNonNullType(type);\n}\nexport function assertType(type) {\n if (!isType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL type.\"));\n }\n\n return type;\n}\n/**\n * There are predicates for each kind of GraphQL type.\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isScalarType(type) {\n return instanceOf(type, GraphQLScalarType);\n}\nexport function assertScalarType(type) {\n if (!isScalarType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Scalar type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isObjectType(type) {\n return instanceOf(type, GraphQLObjectType);\n}\nexport function assertObjectType(type) {\n if (!isObjectType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Object type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isInterfaceType(type) {\n return instanceOf(type, GraphQLInterfaceType);\n}\nexport function assertInterfaceType(type) {\n if (!isInterfaceType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Interface type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isUnionType(type) {\n return instanceOf(type, GraphQLUnionType);\n}\nexport function assertUnionType(type) {\n if (!isUnionType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Union type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isEnumType(type) {\n return instanceOf(type, GraphQLEnumType);\n}\nexport function assertEnumType(type) {\n if (!isEnumType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Enum type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isInputObjectType(type) {\n return instanceOf(type, GraphQLInputObjectType);\n}\nexport function assertInputObjectType(type) {\n if (!isInputObjectType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Input Object type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isListType(type) {\n return instanceOf(type, GraphQLList);\n}\nexport function assertListType(type) {\n if (!isListType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL List type.\"));\n }\n\n return type;\n}\n// eslint-disable-next-line no-redeclare\nexport function isNonNullType(type) {\n return instanceOf(type, GraphQLNonNull);\n}\nexport function assertNonNullType(type) {\n if (!isNonNullType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL Non-Null type.\"));\n }\n\n return type;\n}\n/**\n * These types may be used as input types for arguments and directives.\n */\n\nexport function isInputType(type) {\n return isScalarType(type) || isEnumType(type) || isInputObjectType(type) || isWrappingType(type) && isInputType(type.ofType);\n}\nexport function assertInputType(type) {\n if (!isInputType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL input type.\"));\n }\n\n return type;\n}\n/**\n * These types may be used as output types as the result of fields.\n */\n\nexport function isOutputType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isWrappingType(type) && isOutputType(type.ofType);\n}\nexport function assertOutputType(type) {\n if (!isOutputType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL output type.\"));\n }\n\n return type;\n}\n/**\n * These types may describe types which may be leaf values.\n */\n\nexport function isLeafType(type) {\n return isScalarType(type) || isEnumType(type);\n}\nexport function assertLeafType(type) {\n if (!isLeafType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL leaf type.\"));\n }\n\n return type;\n}\n/**\n * These types may describe the parent context of a selection set.\n */\n\nexport function isCompositeType(type) {\n return isObjectType(type) || isInterfaceType(type) || isUnionType(type);\n}\nexport function assertCompositeType(type) {\n if (!isCompositeType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL composite type.\"));\n }\n\n return type;\n}\n/**\n * These types may describe the parent context of a selection set.\n */\n\nexport function isAbstractType(type) {\n return isInterfaceType(type) || isUnionType(type);\n}\nexport function assertAbstractType(type) {\n if (!isAbstractType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL abstract type.\"));\n }\n\n return type;\n}\n/**\n * List Type Wrapper\n *\n * A list is a wrapping type which points to another type.\n * Lists are often created within the context of defining the fields of\n * an object type.\n *\n * Example:\n *\n * const PersonType = new GraphQLObjectType({\n * name: 'Person',\n * fields: () => ({\n * parents: { type: new GraphQLList(PersonType) },\n * children: { type: new GraphQLList(PersonType) },\n * })\n * })\n *\n */\n// FIXME: workaround to fix issue with Babel parser\n\n/* ::\ndeclare class GraphQLList<+T: GraphQLType> {\n +ofType: T;\n static (ofType: T): GraphQLList;\n // Note: constructors cannot be used for covariant types. Drop the \"new\".\n constructor(ofType: GraphQLType): void;\n}\n*/\n\nexport function GraphQLList(ofType) {\n // istanbul ignore else (to be removed in v16.0.0)\n if (this instanceof GraphQLList) {\n this.ofType = assertType(ofType);\n } else {\n return new GraphQLList(ofType);\n }\n} // Need to cast through any to alter the prototype.\n\nGraphQLList.prototype.toString = function toString() {\n return '[' + String(this.ofType) + ']';\n};\n\nGraphQLList.prototype.toJSON = function toJSON() {\n return this.toString();\n};\n\nObject.defineProperty(GraphQLList.prototype, SYMBOL_TO_STRING_TAG, {\n get: function get() {\n return 'GraphQLList';\n }\n}); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLList);\n/**\n * Non-Null Type Wrapper\n *\n * A non-null is a wrapping type which points to another type.\n * Non-null types enforce that their values are never null and can ensure\n * an error is raised if this ever occurs during a request. It is useful for\n * fields which you can make a strong guarantee on non-nullability, for example\n * usually the id field of a database row will never be null.\n *\n * Example:\n *\n * const RowType = new GraphQLObjectType({\n * name: 'Row',\n * fields: () => ({\n * id: { type: new GraphQLNonNull(GraphQLString) },\n * })\n * })\n *\n * Note: the enforcement of non-nullability occurs within the executor.\n */\n// FIXME: workaround to fix issue with Babel parser\n\n/* ::\ndeclare class GraphQLNonNull<+T: GraphQLNullableType> {\n +ofType: T;\n static (ofType: T): GraphQLNonNull;\n // Note: constructors cannot be used for covariant types. Drop the \"new\".\n constructor(ofType: GraphQLType): void;\n}\n*/\n\nexport function GraphQLNonNull(ofType) {\n // istanbul ignore else (to be removed in v16.0.0)\n if (this instanceof GraphQLNonNull) {\n this.ofType = assertNullableType(ofType);\n } else {\n return new GraphQLNonNull(ofType);\n }\n} // Need to cast through any to alter the prototype.\n\nGraphQLNonNull.prototype.toString = function toString() {\n return String(this.ofType) + '!';\n};\n\nGraphQLNonNull.prototype.toJSON = function toJSON() {\n return this.toString();\n};\n\nObject.defineProperty(GraphQLNonNull.prototype, SYMBOL_TO_STRING_TAG, {\n get: function get() {\n return 'GraphQLNonNull';\n }\n}); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLNonNull);\n/**\n * These types wrap and modify other types\n */\n\nexport function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}\nexport function assertWrappingType(type) {\n if (!isWrappingType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL wrapping type.\"));\n }\n\n return type;\n}\n/**\n * These types can all accept null as a value.\n */\n\nexport function isNullableType(type) {\n return isType(type) && !isNonNullType(type);\n}\nexport function assertNullableType(type) {\n if (!isNullableType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL nullable type.\"));\n }\n\n return type;\n}\n/* eslint-disable no-redeclare */\n\nexport function getNullableType(type) {\n /* eslint-enable no-redeclare */\n if (type) {\n return isNonNullType(type) ? type.ofType : type;\n }\n}\n/**\n * These named types do not include modifiers like List or NonNull.\n */\n\nexport function isNamedType(type) {\n return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type);\n}\nexport function assertNamedType(type) {\n if (!isNamedType(type)) {\n throw new Error(\"Expected \".concat(inspect(type), \" to be a GraphQL named type.\"));\n }\n\n return type;\n}\n/* eslint-disable no-redeclare */\n\nexport function getNamedType(type) {\n /* eslint-enable no-redeclare */\n if (type) {\n var unwrappedType = type;\n\n while (isWrappingType(unwrappedType)) {\n unwrappedType = unwrappedType.ofType;\n }\n\n return unwrappedType;\n }\n}\n/**\n * Used while defining GraphQL types to allow for circular references in\n * otherwise immutable type definitions.\n */\n\nfunction resolveThunk(thunk) {\n // $FlowFixMe[incompatible-use]\n return typeof thunk === 'function' ? thunk() : thunk;\n}\n\nfunction undefineIfEmpty(arr) {\n return arr && arr.length > 0 ? arr : undefined;\n}\n/**\n * Scalar Type Definition\n *\n * The leaf values of any request and input values to arguments are\n * Scalars (or Enums) and are defined with a name and a series of functions\n * used to parse input from ast or variables and to ensure validity.\n *\n * If a type's serialize function does not return a value (i.e. it returns\n * `undefined`) then an error will be raised and a `null` value will be returned\n * in the response. If the serialize function returns `null`, then no error will\n * be included in the response.\n *\n * Example:\n *\n * const OddType = new GraphQLScalarType({\n * name: 'Odd',\n * serialize(value) {\n * if (value % 2 === 1) {\n * return value;\n * }\n * }\n * });\n *\n */\n\n\nexport var GraphQLScalarType = /*#__PURE__*/function () {\n function GraphQLScalarType(config) {\n var _config$parseValue, _config$serialize, _config$parseLiteral;\n\n var parseValue = (_config$parseValue = config.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : identityFunc;\n this.name = config.name;\n this.description = config.description;\n this.specifiedByUrl = config.specifiedByUrl;\n this.serialize = (_config$serialize = config.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : identityFunc;\n this.parseValue = parseValue;\n this.parseLiteral = (_config$parseLiteral = config.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : function (node, variables) {\n return parseValue(valueFromASTUntyped(node, variables));\n };\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n config.specifiedByUrl == null || typeof config.specifiedByUrl === 'string' || devAssert(0, \"\".concat(this.name, \" must provide \\\"specifiedByUrl\\\" as a string, \") + \"but got: \".concat(inspect(config.specifiedByUrl), \".\"));\n config.serialize == null || typeof config.serialize === 'function' || devAssert(0, \"\".concat(this.name, \" must provide \\\"serialize\\\" function. If this custom Scalar is also used as an input type, ensure \\\"parseValue\\\" and \\\"parseLiteral\\\" functions are also provided.\"));\n\n if (config.parseLiteral) {\n typeof config.parseValue === 'function' && typeof config.parseLiteral === 'function' || devAssert(0, \"\".concat(this.name, \" must provide both \\\"parseValue\\\" and \\\"parseLiteral\\\" functions.\"));\n }\n }\n\n var _proto = GraphQLScalarType.prototype;\n\n _proto.toConfig = function toConfig() {\n var _this$extensionASTNod;\n\n return {\n name: this.name,\n description: this.description,\n specifiedByUrl: this.specifiedByUrl,\n serialize: this.serialize,\n parseValue: this.parseValue,\n parseLiteral: this.parseLiteral,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod = this.extensionASTNodes) !== null && _this$extensionASTNod !== void 0 ? _this$extensionASTNod : []\n };\n };\n\n _proto.toString = function toString() {\n return this.name;\n };\n\n _proto.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLScalarType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLScalarType';\n }\n }]);\n\n return GraphQLScalarType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLScalarType);\n\n/**\n * Object Type Definition\n *\n * Almost all of the GraphQL types you define will be object types. Object types\n * have a name, but most importantly describe their fields.\n *\n * Example:\n *\n * const AddressType = new GraphQLObjectType({\n * name: 'Address',\n * fields: {\n * street: { type: GraphQLString },\n * number: { type: GraphQLInt },\n * formatted: {\n * type: GraphQLString,\n * resolve(obj) {\n * return obj.number + ' ' + obj.street\n * }\n * }\n * }\n * });\n *\n * When two types need to refer to each other, or a type needs to refer to\n * itself in a field, you can use a function expression (aka a closure or a\n * thunk) to supply the fields lazily.\n *\n * Example:\n *\n * const PersonType = new GraphQLObjectType({\n * name: 'Person',\n * fields: () => ({\n * name: { type: GraphQLString },\n * bestFriend: { type: PersonType },\n * })\n * });\n *\n */\nexport var GraphQLObjectType = /*#__PURE__*/function () {\n function GraphQLObjectType(config) {\n this.name = config.name;\n this.description = config.description;\n this.isTypeOf = config.isTypeOf;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n this._fields = defineFieldMap.bind(undefined, config);\n this._interfaces = defineInterfaces.bind(undefined, config);\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n config.isTypeOf == null || typeof config.isTypeOf === 'function' || devAssert(0, \"\".concat(this.name, \" must provide \\\"isTypeOf\\\" as a function, \") + \"but got: \".concat(inspect(config.isTypeOf), \".\"));\n }\n\n var _proto2 = GraphQLObjectType.prototype;\n\n _proto2.getFields = function getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n };\n\n _proto2.getInterfaces = function getInterfaces() {\n if (typeof this._interfaces === 'function') {\n this._interfaces = this._interfaces();\n }\n\n return this._interfaces;\n };\n\n _proto2.toConfig = function toConfig() {\n return {\n name: this.name,\n description: this.description,\n interfaces: this.getInterfaces(),\n fields: fieldsToFieldsConfig(this.getFields()),\n isTypeOf: this.isTypeOf,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes || []\n };\n };\n\n _proto2.toString = function toString() {\n return this.name;\n };\n\n _proto2.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLObjectType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLObjectType';\n }\n }]);\n\n return GraphQLObjectType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLObjectType);\n\nfunction defineInterfaces(config) {\n var _resolveThunk;\n\n var interfaces = (_resolveThunk = resolveThunk(config.interfaces)) !== null && _resolveThunk !== void 0 ? _resolveThunk : [];\n Array.isArray(interfaces) || devAssert(0, \"\".concat(config.name, \" interfaces must be an Array or a function which returns an Array.\"));\n return interfaces;\n}\n\nfunction defineFieldMap(config) {\n var fieldMap = resolveThunk(config.fields);\n isPlainObj(fieldMap) || devAssert(0, \"\".concat(config.name, \" fields must be an object with field names as keys or a function which returns such an object.\"));\n return mapValue(fieldMap, function (fieldConfig, fieldName) {\n var _fieldConfig$args;\n\n isPlainObj(fieldConfig) || devAssert(0, \"\".concat(config.name, \".\").concat(fieldName, \" field config must be an object.\"));\n !('isDeprecated' in fieldConfig) || devAssert(0, \"\".concat(config.name, \".\").concat(fieldName, \" should provide \\\"deprecationReason\\\" instead of \\\"isDeprecated\\\".\"));\n fieldConfig.resolve == null || typeof fieldConfig.resolve === 'function' || devAssert(0, \"\".concat(config.name, \".\").concat(fieldName, \" field resolver must be a function if \") + \"provided, but got: \".concat(inspect(fieldConfig.resolve), \".\"));\n var argsConfig = (_fieldConfig$args = fieldConfig.args) !== null && _fieldConfig$args !== void 0 ? _fieldConfig$args : {};\n isPlainObj(argsConfig) || devAssert(0, \"\".concat(config.name, \".\").concat(fieldName, \" args must be an object with argument names as keys.\"));\n var args = objectEntries(argsConfig).map(function (_ref) {\n var argName = _ref[0],\n argConfig = _ref[1];\n return {\n name: argName,\n description: argConfig.description,\n type: argConfig.type,\n defaultValue: argConfig.defaultValue,\n deprecationReason: argConfig.deprecationReason,\n extensions: argConfig.extensions && toObjMap(argConfig.extensions),\n astNode: argConfig.astNode\n };\n });\n return {\n name: fieldName,\n description: fieldConfig.description,\n type: fieldConfig.type,\n args: args,\n resolve: fieldConfig.resolve,\n subscribe: fieldConfig.subscribe,\n isDeprecated: fieldConfig.deprecationReason != null,\n deprecationReason: fieldConfig.deprecationReason,\n extensions: fieldConfig.extensions && toObjMap(fieldConfig.extensions),\n astNode: fieldConfig.astNode\n };\n });\n}\n\nfunction isPlainObj(obj) {\n return isObjectLike(obj) && !Array.isArray(obj);\n}\n\nfunction fieldsToFieldsConfig(fields) {\n return mapValue(fields, function (field) {\n return {\n description: field.description,\n type: field.type,\n args: argsToArgsConfig(field.args),\n resolve: field.resolve,\n subscribe: field.subscribe,\n deprecationReason: field.deprecationReason,\n extensions: field.extensions,\n astNode: field.astNode\n };\n });\n}\n/**\n * @internal\n */\n\n\nexport function argsToArgsConfig(args) {\n return keyValMap(args, function (arg) {\n return arg.name;\n }, function (arg) {\n return {\n description: arg.description,\n type: arg.type,\n defaultValue: arg.defaultValue,\n deprecationReason: arg.deprecationReason,\n extensions: arg.extensions,\n astNode: arg.astNode\n };\n });\n}\nexport function isRequiredArgument(arg) {\n return isNonNullType(arg.type) && arg.defaultValue === undefined;\n}\n\n/**\n * Interface Type Definition\n *\n * When a field can return one of a heterogeneous set of types, a Interface type\n * is used to describe what types are possible, what fields are in common across\n * all types, as well as a function to determine which type is actually used\n * when the field is resolved.\n *\n * Example:\n *\n * const EntityType = new GraphQLInterfaceType({\n * name: 'Entity',\n * fields: {\n * name: { type: GraphQLString }\n * }\n * });\n *\n */\nexport var GraphQLInterfaceType = /*#__PURE__*/function () {\n function GraphQLInterfaceType(config) {\n this.name = config.name;\n this.description = config.description;\n this.resolveType = config.resolveType;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n this._fields = defineFieldMap.bind(undefined, config);\n this._interfaces = defineInterfaces.bind(undefined, config);\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n config.resolveType == null || typeof config.resolveType === 'function' || devAssert(0, \"\".concat(this.name, \" must provide \\\"resolveType\\\" as a function, \") + \"but got: \".concat(inspect(config.resolveType), \".\"));\n }\n\n var _proto3 = GraphQLInterfaceType.prototype;\n\n _proto3.getFields = function getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n };\n\n _proto3.getInterfaces = function getInterfaces() {\n if (typeof this._interfaces === 'function') {\n this._interfaces = this._interfaces();\n }\n\n return this._interfaces;\n };\n\n _proto3.toConfig = function toConfig() {\n var _this$extensionASTNod2;\n\n return {\n name: this.name,\n description: this.description,\n interfaces: this.getInterfaces(),\n fields: fieldsToFieldsConfig(this.getFields()),\n resolveType: this.resolveType,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod2 = this.extensionASTNodes) !== null && _this$extensionASTNod2 !== void 0 ? _this$extensionASTNod2 : []\n };\n };\n\n _proto3.toString = function toString() {\n return this.name;\n };\n\n _proto3.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLInterfaceType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLInterfaceType';\n }\n }]);\n\n return GraphQLInterfaceType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLInterfaceType);\n\n/**\n * Union Type Definition\n *\n * When a field can return one of a heterogeneous set of types, a Union type\n * is used to describe what types are possible as well as providing a function\n * to determine which type is actually used when the field is resolved.\n *\n * Example:\n *\n * const PetType = new GraphQLUnionType({\n * name: 'Pet',\n * types: [ DogType, CatType ],\n * resolveType(value) {\n * if (value instanceof Dog) {\n * return DogType;\n * }\n * if (value instanceof Cat) {\n * return CatType;\n * }\n * }\n * });\n *\n */\nexport var GraphQLUnionType = /*#__PURE__*/function () {\n function GraphQLUnionType(config) {\n this.name = config.name;\n this.description = config.description;\n this.resolveType = config.resolveType;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n this._types = defineTypes.bind(undefined, config);\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n config.resolveType == null || typeof config.resolveType === 'function' || devAssert(0, \"\".concat(this.name, \" must provide \\\"resolveType\\\" as a function, \") + \"but got: \".concat(inspect(config.resolveType), \".\"));\n }\n\n var _proto4 = GraphQLUnionType.prototype;\n\n _proto4.getTypes = function getTypes() {\n if (typeof this._types === 'function') {\n this._types = this._types();\n }\n\n return this._types;\n };\n\n _proto4.toConfig = function toConfig() {\n var _this$extensionASTNod3;\n\n return {\n name: this.name,\n description: this.description,\n types: this.getTypes(),\n resolveType: this.resolveType,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod3 = this.extensionASTNodes) !== null && _this$extensionASTNod3 !== void 0 ? _this$extensionASTNod3 : []\n };\n };\n\n _proto4.toString = function toString() {\n return this.name;\n };\n\n _proto4.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLUnionType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLUnionType';\n }\n }]);\n\n return GraphQLUnionType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLUnionType);\n\nfunction defineTypes(config) {\n var types = resolveThunk(config.types);\n Array.isArray(types) || devAssert(0, \"Must provide Array of types or a function which returns such an array for Union \".concat(config.name, \".\"));\n return types;\n}\n\n/**\n * Enum Type Definition\n *\n * Some leaf values of requests and input values are Enums. GraphQL serializes\n * Enum values as strings, however internally Enums can be represented by any\n * kind of type, often integers.\n *\n * Example:\n *\n * const RGBType = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 }\n * }\n * });\n *\n * Note: If a value is not provided in a definition, the name of the enum value\n * will be used as its internal value.\n */\nexport var GraphQLEnumType\n/* */\n= /*#__PURE__*/function () {\n function GraphQLEnumType(config) {\n this.name = config.name;\n this.description = config.description;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n this._values = defineEnumValues(this.name, config.values);\n this._valueLookup = new Map(this._values.map(function (enumValue) {\n return [enumValue.value, enumValue];\n }));\n this._nameLookup = keyMap(this._values, function (value) {\n return value.name;\n });\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n }\n\n var _proto5 = GraphQLEnumType.prototype;\n\n _proto5.getValues = function getValues() {\n return this._values;\n };\n\n _proto5.getValue = function getValue(name) {\n return this._nameLookup[name];\n };\n\n _proto5.serialize = function serialize(outputValue) {\n var enumValue = this._valueLookup.get(outputValue);\n\n if (enumValue === undefined) {\n throw new GraphQLError(\"Enum \\\"\".concat(this.name, \"\\\" cannot represent value: \").concat(inspect(outputValue)));\n }\n\n return enumValue.name;\n };\n\n _proto5.parseValue = function parseValue(inputValue)\n /* T */\n {\n if (typeof inputValue !== 'string') {\n var valueStr = inspect(inputValue);\n throw new GraphQLError(\"Enum \\\"\".concat(this.name, \"\\\" cannot represent non-string value: \").concat(valueStr, \".\") + didYouMeanEnumValue(this, valueStr));\n }\n\n var enumValue = this.getValue(inputValue);\n\n if (enumValue == null) {\n throw new GraphQLError(\"Value \\\"\".concat(inputValue, \"\\\" does not exist in \\\"\").concat(this.name, \"\\\" enum.\") + didYouMeanEnumValue(this, inputValue));\n }\n\n return enumValue.value;\n };\n\n _proto5.parseLiteral = function parseLiteral(valueNode, _variables)\n /* T */\n {\n // Note: variables will be resolved to a value before calling this function.\n if (valueNode.kind !== Kind.ENUM) {\n var valueStr = print(valueNode);\n throw new GraphQLError(\"Enum \\\"\".concat(this.name, \"\\\" cannot represent non-enum value: \").concat(valueStr, \".\") + didYouMeanEnumValue(this, valueStr), valueNode);\n }\n\n var enumValue = this.getValue(valueNode.value);\n\n if (enumValue == null) {\n var _valueStr = print(valueNode);\n\n throw new GraphQLError(\"Value \\\"\".concat(_valueStr, \"\\\" does not exist in \\\"\").concat(this.name, \"\\\" enum.\") + didYouMeanEnumValue(this, _valueStr), valueNode);\n }\n\n return enumValue.value;\n };\n\n _proto5.toConfig = function toConfig() {\n var _this$extensionASTNod4;\n\n var values = keyValMap(this.getValues(), function (value) {\n return value.name;\n }, function (value) {\n return {\n description: value.description,\n value: value.value,\n deprecationReason: value.deprecationReason,\n extensions: value.extensions,\n astNode: value.astNode\n };\n });\n return {\n name: this.name,\n description: this.description,\n values: values,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod4 = this.extensionASTNodes) !== null && _this$extensionASTNod4 !== void 0 ? _this$extensionASTNod4 : []\n };\n };\n\n _proto5.toString = function toString() {\n return this.name;\n };\n\n _proto5.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLEnumType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLEnumType';\n }\n }]);\n\n return GraphQLEnumType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLEnumType);\n\nfunction didYouMeanEnumValue(enumType, unknownValueStr) {\n var allNames = enumType.getValues().map(function (value) {\n return value.name;\n });\n var suggestedValues = suggestionList(unknownValueStr, allNames);\n return didYouMean('the enum value', suggestedValues);\n}\n\nfunction defineEnumValues(typeName, valueMap) {\n isPlainObj(valueMap) || devAssert(0, \"\".concat(typeName, \" values must be an object with value names as keys.\"));\n return objectEntries(valueMap).map(function (_ref2) {\n var valueName = _ref2[0],\n valueConfig = _ref2[1];\n isPlainObj(valueConfig) || devAssert(0, \"\".concat(typeName, \".\").concat(valueName, \" must refer to an object with a \\\"value\\\" key \") + \"representing an internal value but got: \".concat(inspect(valueConfig), \".\"));\n !('isDeprecated' in valueConfig) || devAssert(0, \"\".concat(typeName, \".\").concat(valueName, \" should provide \\\"deprecationReason\\\" instead of \\\"isDeprecated\\\".\"));\n return {\n name: valueName,\n description: valueConfig.description,\n value: valueConfig.value !== undefined ? valueConfig.value : valueName,\n isDeprecated: valueConfig.deprecationReason != null,\n deprecationReason: valueConfig.deprecationReason,\n extensions: valueConfig.extensions && toObjMap(valueConfig.extensions),\n astNode: valueConfig.astNode\n };\n });\n}\n\n/**\n * Input Object Type Definition\n *\n * An input object defines a structured collection of fields which may be\n * supplied to a field argument.\n *\n * Using `NonNull` will ensure that a value must be provided by the query\n *\n * Example:\n *\n * const GeoPoint = new GraphQLInputObjectType({\n * name: 'GeoPoint',\n * fields: {\n * lat: { type: new GraphQLNonNull(GraphQLFloat) },\n * lon: { type: new GraphQLNonNull(GraphQLFloat) },\n * alt: { type: GraphQLFloat, defaultValue: 0 },\n * }\n * });\n *\n */\nexport var GraphQLInputObjectType = /*#__PURE__*/function () {\n function GraphQLInputObjectType(config) {\n this.name = config.name;\n this.description = config.description;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes);\n this._fields = defineInputFieldMap.bind(undefined, config);\n typeof config.name === 'string' || devAssert(0, 'Must provide name.');\n }\n\n var _proto6 = GraphQLInputObjectType.prototype;\n\n _proto6.getFields = function getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n };\n\n _proto6.toConfig = function toConfig() {\n var _this$extensionASTNod5;\n\n var fields = mapValue(this.getFields(), function (field) {\n return {\n description: field.description,\n type: field.type,\n defaultValue: field.defaultValue,\n extensions: field.extensions,\n astNode: field.astNode\n };\n });\n return {\n name: this.name,\n description: this.description,\n fields: fields,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod5 = this.extensionASTNodes) !== null && _this$extensionASTNod5 !== void 0 ? _this$extensionASTNod5 : []\n };\n };\n\n _proto6.toString = function toString() {\n return this.name;\n };\n\n _proto6.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLInputObjectType, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLInputObjectType';\n }\n }]);\n\n return GraphQLInputObjectType;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLInputObjectType);\n\nfunction defineInputFieldMap(config) {\n var fieldMap = resolveThunk(config.fields);\n isPlainObj(fieldMap) || devAssert(0, \"\".concat(config.name, \" fields must be an object with field names as keys or a function which returns such an object.\"));\n return mapValue(fieldMap, function (fieldConfig, fieldName) {\n !('resolve' in fieldConfig) || devAssert(0, \"\".concat(config.name, \".\").concat(fieldName, \" field has a resolve property, but Input Types cannot define resolvers.\"));\n return {\n name: fieldName,\n description: fieldConfig.description,\n type: fieldConfig.type,\n defaultValue: fieldConfig.defaultValue,\n deprecationReason: fieldConfig.deprecationReason,\n extensions: fieldConfig.extensions && toObjMap(fieldConfig.extensions),\n astNode: fieldConfig.astNode\n };\n });\n}\n\nexport function isRequiredInputField(field) {\n return isNonNullType(field.type) && field.defaultValue === undefined;\n}\n","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport objectEntries from \"../polyfills/objectEntries.mjs\";\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport toObjMap from \"../jsutils/toObjMap.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport instanceOf from \"../jsutils/instanceOf.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport defineInspect from \"../jsutils/defineInspect.mjs\";\nimport { DirectiveLocation } from \"../language/directiveLocation.mjs\";\nimport { GraphQLString, GraphQLBoolean } from \"./scalars.mjs\";\nimport { argsToArgsConfig, GraphQLNonNull } from \"./definition.mjs\";\n/**\n * Test if the given value is a GraphQL directive.\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isDirective(directive) {\n return instanceOf(directive, GraphQLDirective);\n}\nexport function assertDirective(directive) {\n if (!isDirective(directive)) {\n throw new Error(\"Expected \".concat(inspect(directive), \" to be a GraphQL directive.\"));\n }\n\n return directive;\n}\n/**\n * Directives are used by the GraphQL runtime as a way of modifying execution\n * behavior. Type system creators will usually not create these directly.\n */\n\nexport var GraphQLDirective = /*#__PURE__*/function () {\n function GraphQLDirective(config) {\n var _config$isRepeatable, _config$args;\n\n this.name = config.name;\n this.description = config.description;\n this.locations = config.locations;\n this.isRepeatable = (_config$isRepeatable = config.isRepeatable) !== null && _config$isRepeatable !== void 0 ? _config$isRepeatable : false;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n config.name || devAssert(0, 'Directive must be named.');\n Array.isArray(config.locations) || devAssert(0, \"@\".concat(config.name, \" locations must be an Array.\"));\n var args = (_config$args = config.args) !== null && _config$args !== void 0 ? _config$args : {};\n isObjectLike(args) && !Array.isArray(args) || devAssert(0, \"@\".concat(config.name, \" args must be an object with argument names as keys.\"));\n this.args = objectEntries(args).map(function (_ref) {\n var argName = _ref[0],\n argConfig = _ref[1];\n return {\n name: argName,\n description: argConfig.description,\n type: argConfig.type,\n defaultValue: argConfig.defaultValue,\n deprecationReason: argConfig.deprecationReason,\n extensions: argConfig.extensions && toObjMap(argConfig.extensions),\n astNode: argConfig.astNode\n };\n });\n }\n\n var _proto = GraphQLDirective.prototype;\n\n _proto.toConfig = function toConfig() {\n return {\n name: this.name,\n description: this.description,\n locations: this.locations,\n args: argsToArgsConfig(this.args),\n isRepeatable: this.isRepeatable,\n extensions: this.extensions,\n astNode: this.astNode\n };\n };\n\n _proto.toString = function toString() {\n return '@' + this.name;\n };\n\n _proto.toJSON = function toJSON() {\n return this.toString();\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLDirective, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLDirective';\n }\n }]);\n\n return GraphQLDirective;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(GraphQLDirective);\n\n/**\n * Used to conditionally include fields or fragments.\n */\nexport var GraphQLIncludeDirective = new GraphQLDirective({\n name: 'include',\n description: 'Directs the executor to include this field or fragment only when the `if` argument is true.',\n locations: [DirectiveLocation.FIELD, DirectiveLocation.FRAGMENT_SPREAD, DirectiveLocation.INLINE_FRAGMENT],\n args: {\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Included when true.'\n }\n }\n});\n/**\n * Used to conditionally skip (exclude) fields or fragments.\n */\n\nexport var GraphQLSkipDirective = new GraphQLDirective({\n name: 'skip',\n description: 'Directs the executor to skip this field or fragment when the `if` argument is true.',\n locations: [DirectiveLocation.FIELD, DirectiveLocation.FRAGMENT_SPREAD, DirectiveLocation.INLINE_FRAGMENT],\n args: {\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Skipped when true.'\n }\n }\n});\n/**\n * Constant string used for default reason for a deprecation.\n */\n\nexport var DEFAULT_DEPRECATION_REASON = 'No longer supported';\n/**\n * Used to declare element of a GraphQL schema as deprecated.\n */\n\nexport var GraphQLDeprecatedDirective = new GraphQLDirective({\n name: 'deprecated',\n description: 'Marks an element of a GraphQL schema as no longer supported.',\n locations: [DirectiveLocation.FIELD_DEFINITION, DirectiveLocation.ARGUMENT_DEFINITION, DirectiveLocation.INPUT_FIELD_DEFINITION, DirectiveLocation.ENUM_VALUE],\n args: {\n reason: {\n type: GraphQLString,\n description: 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).',\n defaultValue: DEFAULT_DEPRECATION_REASON\n }\n }\n});\n/**\n * Used to provide a URL for specifying the behaviour of custom scalar definitions.\n */\n\nexport var GraphQLSpecifiedByDirective = new GraphQLDirective({\n name: 'specifiedBy',\n description: 'Exposes a URL that specifies the behaviour of this scalar.',\n locations: [DirectiveLocation.SCALAR],\n args: {\n url: {\n type: new GraphQLNonNull(GraphQLString),\n description: 'The URL that specifies the behaviour of this scalar.'\n }\n }\n});\n/**\n * The full list of specified directives.\n */\n\nexport var specifiedDirectives = Object.freeze([GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective]);\nexport function isSpecifiedDirective(directive) {\n return specifiedDirectives.some(function (_ref2) {\n var name = _ref2.name;\n return name === directive.name;\n });\n}\n","import objectValues from \"../polyfills/objectValues.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport { print } from \"../language/printer.mjs\";\nimport { DirectiveLocation } from \"../language/directiveLocation.mjs\";\nimport { astFromValue } from \"../utilities/astFromValue.mjs\";\nimport { GraphQLString, GraphQLBoolean } from \"./scalars.mjs\";\nimport { GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLEnumType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isAbstractType } from \"./definition.mjs\";\nexport var __Schema = new GraphQLObjectType({\n name: '__Schema',\n description: 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.',\n fields: function fields() {\n return {\n description: {\n type: GraphQLString,\n resolve: function resolve(schema) {\n return schema.description;\n }\n },\n types: {\n description: 'A list of all types supported by this server.',\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))),\n resolve: function resolve(schema) {\n return objectValues(schema.getTypeMap());\n }\n },\n queryType: {\n description: 'The type that query operations will be rooted at.',\n type: new GraphQLNonNull(__Type),\n resolve: function resolve(schema) {\n return schema.getQueryType();\n }\n },\n mutationType: {\n description: 'If this server supports mutation, the type that mutation operations will be rooted at.',\n type: __Type,\n resolve: function resolve(schema) {\n return schema.getMutationType();\n }\n },\n subscriptionType: {\n description: 'If this server support subscription, the type that subscription operations will be rooted at.',\n type: __Type,\n resolve: function resolve(schema) {\n return schema.getSubscriptionType();\n }\n },\n directives: {\n description: 'A list of all directives supported by this server.',\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Directive))),\n resolve: function resolve(schema) {\n return schema.getDirectives();\n }\n }\n };\n }\n});\nexport var __Directive = new GraphQLObjectType({\n name: '__Directive',\n description: \"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\\n\\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.\",\n fields: function fields() {\n return {\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: function resolve(directive) {\n return directive.name;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(directive) {\n return directive.description;\n }\n },\n isRepeatable: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: function resolve(directive) {\n return directive.isRepeatable;\n }\n },\n locations: {\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__DirectiveLocation))),\n resolve: function resolve(directive) {\n return directive.locations;\n }\n },\n args: {\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),\n resolve: function resolve(directive) {\n return directive.args;\n }\n }\n };\n }\n});\nexport var __DirectiveLocation = new GraphQLEnumType({\n name: '__DirectiveLocation',\n description: 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.',\n values: {\n QUERY: {\n value: DirectiveLocation.QUERY,\n description: 'Location adjacent to a query operation.'\n },\n MUTATION: {\n value: DirectiveLocation.MUTATION,\n description: 'Location adjacent to a mutation operation.'\n },\n SUBSCRIPTION: {\n value: DirectiveLocation.SUBSCRIPTION,\n description: 'Location adjacent to a subscription operation.'\n },\n FIELD: {\n value: DirectiveLocation.FIELD,\n description: 'Location adjacent to a field.'\n },\n FRAGMENT_DEFINITION: {\n value: DirectiveLocation.FRAGMENT_DEFINITION,\n description: 'Location adjacent to a fragment definition.'\n },\n FRAGMENT_SPREAD: {\n value: DirectiveLocation.FRAGMENT_SPREAD,\n description: 'Location adjacent to a fragment spread.'\n },\n INLINE_FRAGMENT: {\n value: DirectiveLocation.INLINE_FRAGMENT,\n description: 'Location adjacent to an inline fragment.'\n },\n VARIABLE_DEFINITION: {\n value: DirectiveLocation.VARIABLE_DEFINITION,\n description: 'Location adjacent to a variable definition.'\n },\n SCHEMA: {\n value: DirectiveLocation.SCHEMA,\n description: 'Location adjacent to a schema definition.'\n },\n SCALAR: {\n value: DirectiveLocation.SCALAR,\n description: 'Location adjacent to a scalar definition.'\n },\n OBJECT: {\n value: DirectiveLocation.OBJECT,\n description: 'Location adjacent to an object type definition.'\n },\n FIELD_DEFINITION: {\n value: DirectiveLocation.FIELD_DEFINITION,\n description: 'Location adjacent to a field definition.'\n },\n ARGUMENT_DEFINITION: {\n value: DirectiveLocation.ARGUMENT_DEFINITION,\n description: 'Location adjacent to an argument definition.'\n },\n INTERFACE: {\n value: DirectiveLocation.INTERFACE,\n description: 'Location adjacent to an interface definition.'\n },\n UNION: {\n value: DirectiveLocation.UNION,\n description: 'Location adjacent to a union definition.'\n },\n ENUM: {\n value: DirectiveLocation.ENUM,\n description: 'Location adjacent to an enum definition.'\n },\n ENUM_VALUE: {\n value: DirectiveLocation.ENUM_VALUE,\n description: 'Location adjacent to an enum value definition.'\n },\n INPUT_OBJECT: {\n value: DirectiveLocation.INPUT_OBJECT,\n description: 'Location adjacent to an input object type definition.'\n },\n INPUT_FIELD_DEFINITION: {\n value: DirectiveLocation.INPUT_FIELD_DEFINITION,\n description: 'Location adjacent to an input object field definition.'\n }\n }\n});\nexport var __Type = new GraphQLObjectType({\n name: '__Type',\n description: 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\\n\\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByUrl`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.',\n fields: function fields() {\n return {\n kind: {\n type: new GraphQLNonNull(__TypeKind),\n resolve: function resolve(type) {\n if (isScalarType(type)) {\n return TypeKind.SCALAR;\n }\n\n if (isObjectType(type)) {\n return TypeKind.OBJECT;\n }\n\n if (isInterfaceType(type)) {\n return TypeKind.INTERFACE;\n }\n\n if (isUnionType(type)) {\n return TypeKind.UNION;\n }\n\n if (isEnumType(type)) {\n return TypeKind.ENUM;\n }\n\n if (isInputObjectType(type)) {\n return TypeKind.INPUT_OBJECT;\n }\n\n if (isListType(type)) {\n return TypeKind.LIST;\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (isNonNullType(type)) {\n return TypeKind.NON_NULL;\n } // istanbul ignore next (Not reachable. All possible types have been considered)\n\n\n false || invariant(0, \"Unexpected type: \\\"\".concat(inspect(type), \"\\\".\"));\n }\n },\n name: {\n type: GraphQLString,\n resolve: function resolve(type) {\n return type.name !== undefined ? type.name : undefined;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(type) {\n return type.description !== undefined ? type.description : undefined;\n }\n },\n specifiedByUrl: {\n type: GraphQLString,\n resolve: function resolve(obj) {\n return obj.specifiedByUrl !== undefined ? obj.specifiedByUrl : undefined;\n }\n },\n fields: {\n type: new GraphQLList(new GraphQLNonNull(__Field)),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false\n }\n },\n resolve: function resolve(type, _ref) {\n var includeDeprecated = _ref.includeDeprecated;\n\n if (isObjectType(type) || isInterfaceType(type)) {\n var fields = objectValues(type.getFields());\n return includeDeprecated ? fields : fields.filter(function (field) {\n return field.deprecationReason == null;\n });\n }\n }\n },\n interfaces: {\n type: new GraphQLList(new GraphQLNonNull(__Type)),\n resolve: function resolve(type) {\n if (isObjectType(type) || isInterfaceType(type)) {\n return type.getInterfaces();\n }\n }\n },\n possibleTypes: {\n type: new GraphQLList(new GraphQLNonNull(__Type)),\n resolve: function resolve(type, _args, _context, _ref2) {\n var schema = _ref2.schema;\n\n if (isAbstractType(type)) {\n return schema.getPossibleTypes(type);\n }\n }\n },\n enumValues: {\n type: new GraphQLList(new GraphQLNonNull(__EnumValue)),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false\n }\n },\n resolve: function resolve(type, _ref3) {\n var includeDeprecated = _ref3.includeDeprecated;\n\n if (isEnumType(type)) {\n var values = type.getValues();\n return includeDeprecated ? values : values.filter(function (field) {\n return field.deprecationReason == null;\n });\n }\n }\n },\n inputFields: {\n type: new GraphQLList(new GraphQLNonNull(__InputValue)),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false\n }\n },\n resolve: function resolve(type, _ref4) {\n var includeDeprecated = _ref4.includeDeprecated;\n\n if (isInputObjectType(type)) {\n var values = objectValues(type.getFields());\n return includeDeprecated ? values : values.filter(function (field) {\n return field.deprecationReason == null;\n });\n }\n }\n },\n ofType: {\n type: __Type,\n resolve: function resolve(type) {\n return type.ofType !== undefined ? type.ofType : undefined;\n }\n }\n };\n }\n});\nexport var __Field = new GraphQLObjectType({\n name: '__Field',\n description: 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.',\n fields: function fields() {\n return {\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: function resolve(field) {\n return field.name;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(field) {\n return field.description;\n }\n },\n args: {\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false\n }\n },\n resolve: function resolve(field, _ref5) {\n var includeDeprecated = _ref5.includeDeprecated;\n return includeDeprecated ? field.args : field.args.filter(function (arg) {\n return arg.deprecationReason == null;\n });\n }\n },\n type: {\n type: new GraphQLNonNull(__Type),\n resolve: function resolve(field) {\n return field.type;\n }\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: function resolve(field) {\n return field.deprecationReason != null;\n }\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: function resolve(field) {\n return field.deprecationReason;\n }\n }\n };\n }\n});\nexport var __InputValue = new GraphQLObjectType({\n name: '__InputValue',\n description: 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.',\n fields: function fields() {\n return {\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: function resolve(inputValue) {\n return inputValue.name;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(inputValue) {\n return inputValue.description;\n }\n },\n type: {\n type: new GraphQLNonNull(__Type),\n resolve: function resolve(inputValue) {\n return inputValue.type;\n }\n },\n defaultValue: {\n type: GraphQLString,\n description: 'A GraphQL-formatted string representing the default value for this input value.',\n resolve: function resolve(inputValue) {\n var type = inputValue.type,\n defaultValue = inputValue.defaultValue;\n var valueAST = astFromValue(defaultValue, type);\n return valueAST ? print(valueAST) : null;\n }\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: function resolve(field) {\n return field.deprecationReason != null;\n }\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: function resolve(obj) {\n return obj.deprecationReason;\n }\n }\n };\n }\n});\nexport var __EnumValue = new GraphQLObjectType({\n name: '__EnumValue',\n description: 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.',\n fields: function fields() {\n return {\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: function resolve(enumValue) {\n return enumValue.name;\n }\n },\n description: {\n type: GraphQLString,\n resolve: function resolve(enumValue) {\n return enumValue.description;\n }\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: function resolve(enumValue) {\n return enumValue.deprecationReason != null;\n }\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: function resolve(enumValue) {\n return enumValue.deprecationReason;\n }\n }\n };\n }\n});\nexport var TypeKind = Object.freeze({\n SCALAR: 'SCALAR',\n OBJECT: 'OBJECT',\n INTERFACE: 'INTERFACE',\n UNION: 'UNION',\n ENUM: 'ENUM',\n INPUT_OBJECT: 'INPUT_OBJECT',\n LIST: 'LIST',\n NON_NULL: 'NON_NULL'\n});\nexport var __TypeKind = new GraphQLEnumType({\n name: '__TypeKind',\n description: 'An enum describing what kind of type a given `__Type` is.',\n values: {\n SCALAR: {\n value: TypeKind.SCALAR,\n description: 'Indicates this type is a scalar.'\n },\n OBJECT: {\n value: TypeKind.OBJECT,\n description: 'Indicates this type is an object. `fields` and `interfaces` are valid fields.'\n },\n INTERFACE: {\n value: TypeKind.INTERFACE,\n description: 'Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.'\n },\n UNION: {\n value: TypeKind.UNION,\n description: 'Indicates this type is a union. `possibleTypes` is a valid field.'\n },\n ENUM: {\n value: TypeKind.ENUM,\n description: 'Indicates this type is an enum. `enumValues` is a valid field.'\n },\n INPUT_OBJECT: {\n value: TypeKind.INPUT_OBJECT,\n description: 'Indicates this type is an input object. `inputFields` is a valid field.'\n },\n LIST: {\n value: TypeKind.LIST,\n description: 'Indicates this type is a list. `ofType` is a valid field.'\n },\n NON_NULL: {\n value: TypeKind.NON_NULL,\n description: 'Indicates this type is a non-null. `ofType` is a valid field.'\n }\n }\n});\n/**\n * Note that these are GraphQLField and not GraphQLFieldConfig,\n * so the format for args is different.\n */\n\nexport var SchemaMetaFieldDef = {\n name: '__schema',\n type: new GraphQLNonNull(__Schema),\n description: 'Access the current type schema of this server.',\n args: [],\n resolve: function resolve(_source, _args, _context, _ref6) {\n var schema = _ref6.schema;\n return schema;\n },\n isDeprecated: false,\n deprecationReason: undefined,\n extensions: undefined,\n astNode: undefined\n};\nexport var TypeMetaFieldDef = {\n name: '__type',\n type: __Type,\n description: 'Request the type information of a single type.',\n args: [{\n name: 'name',\n description: undefined,\n type: new GraphQLNonNull(GraphQLString),\n defaultValue: undefined,\n deprecationReason: undefined,\n extensions: undefined,\n astNode: undefined\n }],\n resolve: function resolve(_source, _ref7, _context, _ref8) {\n var name = _ref7.name;\n var schema = _ref8.schema;\n return schema.getType(name);\n },\n isDeprecated: false,\n deprecationReason: undefined,\n extensions: undefined,\n astNode: undefined\n};\nexport var TypeNameMetaFieldDef = {\n name: '__typename',\n type: new GraphQLNonNull(GraphQLString),\n description: 'The name of the current Object type at runtime.',\n args: [],\n resolve: function resolve(_source, _args, _context, _ref9) {\n var parentType = _ref9.parentType;\n return parentType.name;\n },\n isDeprecated: false,\n deprecationReason: undefined,\n extensions: undefined,\n astNode: undefined\n};\nexport var introspectionTypes = Object.freeze([__Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind]);\nexport function isIntrospectionType(type) {\n return introspectionTypes.some(function (_ref10) {\n var name = _ref10.name;\n return type.name === name;\n });\n}\n","/* eslint-disable no-redeclare */\n// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441\nvar isInteger = Number.isInteger || function (value) {\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\n};\n\nexport default isInteger;\n","import isFinite from \"../polyfills/isFinite.mjs\";\nimport isInteger from \"../polyfills/isInteger.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { print } from \"../language/printer.mjs\";\nimport { GraphQLError } from \"../error/GraphQLError.mjs\";\nimport { GraphQLScalarType } from \"./definition.mjs\"; // As per the GraphQL Spec, Integers are only treated as valid when a valid\n// 32-bit signed integer, providing the broadest support across platforms.\n//\n// n.b. JavaScript's integers are safe between -(2^53 - 1) and 2^53 - 1 because\n// they are internally represented as IEEE 754 doubles.\n\nvar MAX_INT = 2147483647;\nvar MIN_INT = -2147483648;\n\nfunction serializeInt(outputValue) {\n var coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 1 : 0;\n }\n\n var num = coercedValue;\n\n if (typeof coercedValue === 'string' && coercedValue !== '') {\n num = Number(coercedValue);\n }\n\n if (!isInteger(num)) {\n throw new GraphQLError(\"Int cannot represent non-integer value: \".concat(inspect(coercedValue)));\n }\n\n if (num > MAX_INT || num < MIN_INT) {\n throw new GraphQLError('Int cannot represent non 32-bit signed integer value: ' + inspect(coercedValue));\n }\n\n return num;\n}\n\nfunction coerceInt(inputValue) {\n if (!isInteger(inputValue)) {\n throw new GraphQLError(\"Int cannot represent non-integer value: \".concat(inspect(inputValue)));\n }\n\n if (inputValue > MAX_INT || inputValue < MIN_INT) {\n throw new GraphQLError(\"Int cannot represent non 32-bit signed integer value: \".concat(inputValue));\n }\n\n return inputValue;\n}\n\nexport var GraphQLInt = new GraphQLScalarType({\n name: 'Int',\n description: 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.',\n serialize: serializeInt,\n parseValue: coerceInt,\n parseLiteral: function parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\"Int cannot represent non-integer value: \".concat(print(valueNode)), valueNode);\n }\n\n var num = parseInt(valueNode.value, 10);\n\n if (num > MAX_INT || num < MIN_INT) {\n throw new GraphQLError(\"Int cannot represent non 32-bit signed integer value: \".concat(valueNode.value), valueNode);\n }\n\n return num;\n }\n});\n\nfunction serializeFloat(outputValue) {\n var coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 1 : 0;\n }\n\n var num = coercedValue;\n\n if (typeof coercedValue === 'string' && coercedValue !== '') {\n num = Number(coercedValue);\n }\n\n if (!isFinite(num)) {\n throw new GraphQLError(\"Float cannot represent non numeric value: \".concat(inspect(coercedValue)));\n }\n\n return num;\n}\n\nfunction coerceFloat(inputValue) {\n if (!isFinite(inputValue)) {\n throw new GraphQLError(\"Float cannot represent non numeric value: \".concat(inspect(inputValue)));\n }\n\n return inputValue;\n}\n\nexport var GraphQLFloat = new GraphQLScalarType({\n name: 'Float',\n description: 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).',\n serialize: serializeFloat,\n parseValue: coerceFloat,\n parseLiteral: function parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.FLOAT && valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\"Float cannot represent non numeric value: \".concat(print(valueNode)), valueNode);\n }\n\n return parseFloat(valueNode.value);\n }\n}); // Support serializing objects with custom valueOf() or toJSON() functions -\n// a common way to represent a complex value which can be represented as\n// a string (ex: MongoDB id objects).\n\nfunction serializeObject(outputValue) {\n if (isObjectLike(outputValue)) {\n if (typeof outputValue.valueOf === 'function') {\n var valueOfResult = outputValue.valueOf();\n\n if (!isObjectLike(valueOfResult)) {\n return valueOfResult;\n }\n }\n\n if (typeof outputValue.toJSON === 'function') {\n // $FlowFixMe[incompatible-use]\n return outputValue.toJSON();\n }\n }\n\n return outputValue;\n}\n\nfunction serializeString(outputValue) {\n var coercedValue = serializeObject(outputValue); // Serialize string, boolean and number values to a string, but do not\n // attempt to coerce object, function, symbol, or other types as strings.\n\n if (typeof coercedValue === 'string') {\n return coercedValue;\n }\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 'true' : 'false';\n }\n\n if (isFinite(coercedValue)) {\n return coercedValue.toString();\n }\n\n throw new GraphQLError(\"String cannot represent value: \".concat(inspect(outputValue)));\n}\n\nfunction coerceString(inputValue) {\n if (typeof inputValue !== 'string') {\n throw new GraphQLError(\"String cannot represent a non string value: \".concat(inspect(inputValue)));\n }\n\n return inputValue;\n}\n\nexport var GraphQLString = new GraphQLScalarType({\n name: 'String',\n description: 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.',\n serialize: serializeString,\n parseValue: coerceString,\n parseLiteral: function parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.STRING) {\n throw new GraphQLError(\"String cannot represent a non string value: \".concat(print(valueNode)), valueNode);\n }\n\n return valueNode.value;\n }\n});\n\nfunction serializeBoolean(outputValue) {\n var coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue;\n }\n\n if (isFinite(coercedValue)) {\n return coercedValue !== 0;\n }\n\n throw new GraphQLError(\"Boolean cannot represent a non boolean value: \".concat(inspect(coercedValue)));\n}\n\nfunction coerceBoolean(inputValue) {\n if (typeof inputValue !== 'boolean') {\n throw new GraphQLError(\"Boolean cannot represent a non boolean value: \".concat(inspect(inputValue)));\n }\n\n return inputValue;\n}\n\nexport var GraphQLBoolean = new GraphQLScalarType({\n name: 'Boolean',\n description: 'The `Boolean` scalar type represents `true` or `false`.',\n serialize: serializeBoolean,\n parseValue: coerceBoolean,\n parseLiteral: function parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.BOOLEAN) {\n throw new GraphQLError(\"Boolean cannot represent a non boolean value: \".concat(print(valueNode)), valueNode);\n }\n\n return valueNode.value;\n }\n});\n\nfunction serializeID(outputValue) {\n var coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'string') {\n return coercedValue;\n }\n\n if (isInteger(coercedValue)) {\n return String(coercedValue);\n }\n\n throw new GraphQLError(\"ID cannot represent value: \".concat(inspect(outputValue)));\n}\n\nfunction coerceID(inputValue) {\n if (typeof inputValue === 'string') {\n return inputValue;\n }\n\n if (isInteger(inputValue)) {\n return inputValue.toString();\n }\n\n throw new GraphQLError(\"ID cannot represent value: \".concat(inspect(inputValue)));\n}\n\nexport var GraphQLID = new GraphQLScalarType({\n name: 'ID',\n description: 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.',\n serialize: serializeID,\n parseValue: coerceID,\n parseLiteral: function parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.STRING && valueNode.kind !== Kind.INT) {\n throw new GraphQLError('ID cannot represent a non-string and non-integer value: ' + print(valueNode), valueNode);\n }\n\n return valueNode.value;\n }\n});\nexport var specifiedScalarTypes = Object.freeze([GraphQLString, GraphQLInt, GraphQLFloat, GraphQLBoolean, GraphQLID]);\nexport function isSpecifiedScalarType(type) {\n return specifiedScalarTypes.some(function (_ref) {\n var name = _ref.name;\n return type.name === name;\n });\n}\n","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport find from \"../polyfills/find.mjs\";\nimport arrayFrom from \"../polyfills/arrayFrom.mjs\";\nimport objectValues from \"../polyfills/objectValues.mjs\";\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport toObjMap from \"../jsutils/toObjMap.mjs\";\nimport devAssert from \"../jsutils/devAssert.mjs\";\nimport instanceOf from \"../jsutils/instanceOf.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport { __Schema } from \"./introspection.mjs\";\nimport { GraphQLDirective, isDirective, specifiedDirectives } from \"./directives.mjs\";\nimport { isObjectType, isInterfaceType, isUnionType, isInputObjectType, getNamedType } from \"./definition.mjs\";\n/**\n * Test if the given value is a GraphQL schema.\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isSchema(schema) {\n return instanceOf(schema, GraphQLSchema);\n}\nexport function assertSchema(schema) {\n if (!isSchema(schema)) {\n throw new Error(\"Expected \".concat(inspect(schema), \" to be a GraphQL schema.\"));\n }\n\n return schema;\n}\n/**\n * Schema Definition\n *\n * A Schema is created by supplying the root types of each type of operation,\n * query and mutation (optional). A schema definition is then supplied to the\n * validator and executor.\n *\n * Example:\n *\n * const MyAppSchema = new GraphQLSchema({\n * query: MyAppQueryRootType,\n * mutation: MyAppMutationRootType,\n * })\n *\n * Note: When the schema is constructed, by default only the types that are\n * reachable by traversing the root types are included, other types must be\n * explicitly referenced.\n *\n * Example:\n *\n * const characterInterface = new GraphQLInterfaceType({\n * name: 'Character',\n * ...\n * });\n *\n * const humanType = new GraphQLObjectType({\n * name: 'Human',\n * interfaces: [characterInterface],\n * ...\n * });\n *\n * const droidType = new GraphQLObjectType({\n * name: 'Droid',\n * interfaces: [characterInterface],\n * ...\n * });\n *\n * const schema = new GraphQLSchema({\n * query: new GraphQLObjectType({\n * name: 'Query',\n * fields: {\n * hero: { type: characterInterface, ... },\n * }\n * }),\n * ...\n * // Since this schema references only the `Character` interface it's\n * // necessary to explicitly list the types that implement it if\n * // you want them to be included in the final schema.\n * types: [humanType, droidType],\n * })\n *\n * Note: If an array of `directives` are provided to GraphQLSchema, that will be\n * the exact list of directives represented and allowed. If `directives` is not\n * provided then a default set of the specified directives (e.g. @include and\n * @skip) will be used. If you wish to provide *additional* directives to these\n * specified directives, you must explicitly declare them. Example:\n *\n * const MyAppSchema = new GraphQLSchema({\n * ...\n * directives: specifiedDirectives.concat([ myCustomDirective ]),\n * })\n *\n */\n\nexport var GraphQLSchema = /*#__PURE__*/function () {\n // Used as a cache for validateSchema().\n function GraphQLSchema(config) {\n var _config$directives;\n\n // If this schema was built from a source known to be valid, then it may be\n // marked with assumeValid to avoid an additional type system validation.\n this.__validationErrors = config.assumeValid === true ? [] : undefined; // Check for common mistakes during construction to produce early errors.\n\n isObjectLike(config) || devAssert(0, 'Must provide configuration object.');\n !config.types || Array.isArray(config.types) || devAssert(0, \"\\\"types\\\" must be Array if provided but got: \".concat(inspect(config.types), \".\"));\n !config.directives || Array.isArray(config.directives) || devAssert(0, '\"directives\" must be Array if provided but got: ' + \"\".concat(inspect(config.directives), \".\"));\n this.description = config.description;\n this.extensions = config.extensions && toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes = config.extensionASTNodes;\n this._queryType = config.query;\n this._mutationType = config.mutation;\n this._subscriptionType = config.subscription; // Provide specified directives (e.g. @include and @skip) by default.\n\n this._directives = (_config$directives = config.directives) !== null && _config$directives !== void 0 ? _config$directives : specifiedDirectives; // To preserve order of user-provided types, we add first to add them to\n // the set of \"collected\" types, so `collectReferencedTypes` ignore them.\n\n var allReferencedTypes = new Set(config.types);\n\n if (config.types != null) {\n for (var _i2 = 0, _config$types2 = config.types; _i2 < _config$types2.length; _i2++) {\n var type = _config$types2[_i2];\n // When we ready to process this type, we remove it from \"collected\" types\n // and then add it together with all dependent types in the correct position.\n allReferencedTypes.delete(type);\n collectReferencedTypes(type, allReferencedTypes);\n }\n }\n\n if (this._queryType != null) {\n collectReferencedTypes(this._queryType, allReferencedTypes);\n }\n\n if (this._mutationType != null) {\n collectReferencedTypes(this._mutationType, allReferencedTypes);\n }\n\n if (this._subscriptionType != null) {\n collectReferencedTypes(this._subscriptionType, allReferencedTypes);\n }\n\n for (var _i4 = 0, _this$_directives2 = this._directives; _i4 < _this$_directives2.length; _i4++) {\n var directive = _this$_directives2[_i4];\n\n // Directives are not validated until validateSchema() is called.\n if (isDirective(directive)) {\n for (var _i6 = 0, _directive$args2 = directive.args; _i6 < _directive$args2.length; _i6++) {\n var arg = _directive$args2[_i6];\n collectReferencedTypes(arg.type, allReferencedTypes);\n }\n }\n }\n\n collectReferencedTypes(__Schema, allReferencedTypes); // Storing the resulting map for reference by the schema.\n\n this._typeMap = Object.create(null);\n this._subTypeMap = Object.create(null); // Keep track of all implementations by interface name.\n\n this._implementationsMap = Object.create(null);\n\n for (var _i8 = 0, _arrayFrom2 = arrayFrom(allReferencedTypes); _i8 < _arrayFrom2.length; _i8++) {\n var namedType = _arrayFrom2[_i8];\n\n if (namedType == null) {\n continue;\n }\n\n var typeName = namedType.name;\n typeName || devAssert(0, 'One of the provided types for building the Schema is missing a name.');\n\n if (this._typeMap[typeName] !== undefined) {\n throw new Error(\"Schema must contain uniquely named types but contains multiple types named \\\"\".concat(typeName, \"\\\".\"));\n }\n\n this._typeMap[typeName] = namedType;\n\n if (isInterfaceType(namedType)) {\n // Store implementations by interface.\n for (var _i10 = 0, _namedType$getInterfa2 = namedType.getInterfaces(); _i10 < _namedType$getInterfa2.length; _i10++) {\n var iface = _namedType$getInterfa2[_i10];\n\n if (isInterfaceType(iface)) {\n var implementations = this._implementationsMap[iface.name];\n\n if (implementations === undefined) {\n implementations = this._implementationsMap[iface.name] = {\n objects: [],\n interfaces: []\n };\n }\n\n implementations.interfaces.push(namedType);\n }\n }\n } else if (isObjectType(namedType)) {\n // Store implementations by objects.\n for (var _i12 = 0, _namedType$getInterfa4 = namedType.getInterfaces(); _i12 < _namedType$getInterfa4.length; _i12++) {\n var _iface = _namedType$getInterfa4[_i12];\n\n if (isInterfaceType(_iface)) {\n var _implementations = this._implementationsMap[_iface.name];\n\n if (_implementations === undefined) {\n _implementations = this._implementationsMap[_iface.name] = {\n objects: [],\n interfaces: []\n };\n }\n\n _implementations.objects.push(namedType);\n }\n }\n }\n }\n }\n\n var _proto = GraphQLSchema.prototype;\n\n _proto.getQueryType = function getQueryType() {\n return this._queryType;\n };\n\n _proto.getMutationType = function getMutationType() {\n return this._mutationType;\n };\n\n _proto.getSubscriptionType = function getSubscriptionType() {\n return this._subscriptionType;\n };\n\n _proto.getTypeMap = function getTypeMap() {\n return this._typeMap;\n };\n\n _proto.getType = function getType(name) {\n return this.getTypeMap()[name];\n };\n\n _proto.getPossibleTypes = function getPossibleTypes(abstractType) {\n return isUnionType(abstractType) ? abstractType.getTypes() : this.getImplementations(abstractType).objects;\n };\n\n _proto.getImplementations = function getImplementations(interfaceType) {\n var implementations = this._implementationsMap[interfaceType.name];\n return implementations !== null && implementations !== void 0 ? implementations : {\n objects: [],\n interfaces: []\n };\n } // @deprecated: use isSubType instead - will be removed in v16.\n ;\n\n _proto.isPossibleType = function isPossibleType(abstractType, possibleType) {\n return this.isSubType(abstractType, possibleType);\n };\n\n _proto.isSubType = function isSubType(abstractType, maybeSubType) {\n var map = this._subTypeMap[abstractType.name];\n\n if (map === undefined) {\n map = Object.create(null);\n\n if (isUnionType(abstractType)) {\n for (var _i14 = 0, _abstractType$getType2 = abstractType.getTypes(); _i14 < _abstractType$getType2.length; _i14++) {\n var type = _abstractType$getType2[_i14];\n map[type.name] = true;\n }\n } else {\n var implementations = this.getImplementations(abstractType);\n\n for (var _i16 = 0, _implementations$obje2 = implementations.objects; _i16 < _implementations$obje2.length; _i16++) {\n var _type = _implementations$obje2[_i16];\n map[_type.name] = true;\n }\n\n for (var _i18 = 0, _implementations$inte2 = implementations.interfaces; _i18 < _implementations$inte2.length; _i18++) {\n var _type2 = _implementations$inte2[_i18];\n map[_type2.name] = true;\n }\n }\n\n this._subTypeMap[abstractType.name] = map;\n }\n\n return map[maybeSubType.name] !== undefined;\n };\n\n _proto.getDirectives = function getDirectives() {\n return this._directives;\n };\n\n _proto.getDirective = function getDirective(name) {\n return find(this.getDirectives(), function (directive) {\n return directive.name === name;\n });\n };\n\n _proto.toConfig = function toConfig() {\n var _this$extensionASTNod;\n\n return {\n description: this.description,\n query: this.getQueryType(),\n mutation: this.getMutationType(),\n subscription: this.getSubscriptionType(),\n types: objectValues(this.getTypeMap()),\n directives: this.getDirectives().slice(),\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: (_this$extensionASTNod = this.extensionASTNodes) !== null && _this$extensionASTNod !== void 0 ? _this$extensionASTNod : [],\n assumeValid: this.__validationErrors !== undefined\n };\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n ;\n\n _createClass(GraphQLSchema, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'GraphQLSchema';\n }\n }]);\n\n return GraphQLSchema;\n}();\n\nfunction collectReferencedTypes(type, typeSet) {\n var namedType = getNamedType(type);\n\n if (!typeSet.has(namedType)) {\n typeSet.add(namedType);\n\n if (isUnionType(namedType)) {\n for (var _i20 = 0, _namedType$getTypes2 = namedType.getTypes(); _i20 < _namedType$getTypes2.length; _i20++) {\n var memberType = _namedType$getTypes2[_i20];\n collectReferencedTypes(memberType, typeSet);\n }\n } else if (isObjectType(namedType) || isInterfaceType(namedType)) {\n for (var _i22 = 0, _namedType$getInterfa6 = namedType.getInterfaces(); _i22 < _namedType$getInterfa6.length; _i22++) {\n var interfaceType = _namedType$getInterfa6[_i22];\n collectReferencedTypes(interfaceType, typeSet);\n }\n\n for (var _i24 = 0, _objectValues2 = objectValues(namedType.getFields()); _i24 < _objectValues2.length; _i24++) {\n var field = _objectValues2[_i24];\n collectReferencedTypes(field.type, typeSet);\n\n for (var _i26 = 0, _field$args2 = field.args; _i26 < _field$args2.length; _i26++) {\n var arg = _field$args2[_i26];\n collectReferencedTypes(arg.type, typeSet);\n }\n }\n } else if (isInputObjectType(namedType)) {\n for (var _i28 = 0, _objectValues4 = objectValues(namedType.getFields()); _i28 < _objectValues4.length; _i28++) {\n var _field = _objectValues4[_i28];\n collectReferencedTypes(_field.type, typeSet);\n }\n }\n }\n\n return typeSet;\n}\n","import devAssert from \"../jsutils/devAssert.mjs\";\nimport { GraphQLError } from \"../error/GraphQLError.mjs\";\nvar NAME_RX = /^[_a-zA-Z][_a-zA-Z0-9]*$/;\n/**\n * Upholds the spec rules about naming.\n */\n\nexport function assertValidName(name) {\n var error = isValidNameError(name);\n\n if (error) {\n throw error;\n }\n\n return name;\n}\n/**\n * Returns an Error if a name is invalid.\n */\n\nexport function isValidNameError(name) {\n typeof name === 'string' || devAssert(0, 'Expected name to be a string.');\n\n if (name.length > 1 && name[0] === '_' && name[1] === '_') {\n return new GraphQLError(\"Name \\\"\".concat(name, \"\\\" must not begin with \\\"__\\\", which is reserved by GraphQL introspection.\"));\n }\n\n if (!NAME_RX.test(name)) {\n return new GraphQLError(\"Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \\\"\".concat(name, \"\\\" does not.\"));\n }\n}\n","import find from \"../polyfills/find.mjs\";\nimport objectValues from \"../polyfills/objectValues.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport { GraphQLError } from \"../error/GraphQLError.mjs\";\nimport { locatedError } from \"../error/locatedError.mjs\";\nimport { isValidNameError } from \"../utilities/assertValidName.mjs\";\nimport { isEqualType, isTypeSubTypeOf } from \"../utilities/typeComparators.mjs\";\nimport { assertSchema } from \"./schema.mjs\";\nimport { isIntrospectionType } from \"./introspection.mjs\";\nimport { isDirective, GraphQLDeprecatedDirective } from \"./directives.mjs\";\nimport { isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isNamedType, isNonNullType, isInputType, isOutputType, isRequiredArgument, isRequiredInputField } from \"./definition.mjs\";\n/**\n * Implements the \"Type Validation\" sub-sections of the specification's\n * \"Type System\" section.\n *\n * Validation runs synchronously, returning an array of encountered errors, or\n * an empty array if no errors were encountered and the Schema is valid.\n */\n\nexport function validateSchema(schema) {\n // First check to ensure the provided value is in fact a GraphQLSchema.\n assertSchema(schema); // If this Schema has already been validated, return the previous results.\n\n if (schema.__validationErrors) {\n return schema.__validationErrors;\n } // Validate the schema, producing a list of errors.\n\n\n var context = new SchemaValidationContext(schema);\n validateRootTypes(context);\n validateDirectives(context);\n validateTypes(context); // Persist the results of validation before returning to ensure validation\n // does not run multiple times for this schema.\n\n var errors = context.getErrors();\n schema.__validationErrors = errors;\n return errors;\n}\n/**\n * Utility function which asserts a schema is valid by throwing an error if\n * it is invalid.\n */\n\nexport function assertValidSchema(schema) {\n var errors = validateSchema(schema);\n\n if (errors.length !== 0) {\n throw new Error(errors.map(function (error) {\n return error.message;\n }).join('\\n\\n'));\n }\n}\n\nvar SchemaValidationContext = /*#__PURE__*/function () {\n function SchemaValidationContext(schema) {\n this._errors = [];\n this.schema = schema;\n }\n\n var _proto = SchemaValidationContext.prototype;\n\n _proto.reportError = function reportError(message, nodes) {\n var _nodes = Array.isArray(nodes) ? nodes.filter(Boolean) : nodes;\n\n this.addError(new GraphQLError(message, _nodes));\n };\n\n _proto.addError = function addError(error) {\n this._errors.push(error);\n };\n\n _proto.getErrors = function getErrors() {\n return this._errors;\n };\n\n return SchemaValidationContext;\n}();\n\nfunction validateRootTypes(context) {\n var schema = context.schema;\n var queryType = schema.getQueryType();\n\n if (!queryType) {\n context.reportError('Query root type must be provided.', schema.astNode);\n } else if (!isObjectType(queryType)) {\n var _getOperationTypeNode;\n\n context.reportError(\"Query root type must be Object type, it cannot be \".concat(inspect(queryType), \".\"), (_getOperationTypeNode = getOperationTypeNode(schema, 'query')) !== null && _getOperationTypeNode !== void 0 ? _getOperationTypeNode : queryType.astNode);\n }\n\n var mutationType = schema.getMutationType();\n\n if (mutationType && !isObjectType(mutationType)) {\n var _getOperationTypeNode2;\n\n context.reportError('Mutation root type must be Object type if provided, it cannot be ' + \"\".concat(inspect(mutationType), \".\"), (_getOperationTypeNode2 = getOperationTypeNode(schema, 'mutation')) !== null && _getOperationTypeNode2 !== void 0 ? _getOperationTypeNode2 : mutationType.astNode);\n }\n\n var subscriptionType = schema.getSubscriptionType();\n\n if (subscriptionType && !isObjectType(subscriptionType)) {\n var _getOperationTypeNode3;\n\n context.reportError('Subscription root type must be Object type if provided, it cannot be ' + \"\".concat(inspect(subscriptionType), \".\"), (_getOperationTypeNode3 = getOperationTypeNode(schema, 'subscription')) !== null && _getOperationTypeNode3 !== void 0 ? _getOperationTypeNode3 : subscriptionType.astNode);\n }\n}\n\nfunction getOperationTypeNode(schema, operation) {\n var operationNodes = getAllSubNodes(schema, function (node) {\n return node.operationTypes;\n });\n\n for (var _i2 = 0; _i2 < operationNodes.length; _i2++) {\n var node = operationNodes[_i2];\n\n if (node.operation === operation) {\n return node.type;\n }\n }\n\n return undefined;\n}\n\nfunction validateDirectives(context) {\n for (var _i4 = 0, _context$schema$getDi2 = context.schema.getDirectives(); _i4 < _context$schema$getDi2.length; _i4++) {\n var directive = _context$schema$getDi2[_i4];\n\n // Ensure all directives are in fact GraphQL directives.\n if (!isDirective(directive)) {\n context.reportError(\"Expected directive but got: \".concat(inspect(directive), \".\"), directive === null || directive === void 0 ? void 0 : directive.astNode);\n continue;\n } // Ensure they are named correctly.\n\n\n validateName(context, directive); // TODO: Ensure proper locations.\n // Ensure the arguments are valid.\n\n for (var _i6 = 0, _directive$args2 = directive.args; _i6 < _directive$args2.length; _i6++) {\n var arg = _directive$args2[_i6];\n // Ensure they are named correctly.\n validateName(context, arg); // Ensure the type is an input type.\n\n if (!isInputType(arg.type)) {\n context.reportError(\"The type of @\".concat(directive.name, \"(\").concat(arg.name, \":) must be Input Type \") + \"but got: \".concat(inspect(arg.type), \".\"), arg.astNode);\n }\n\n if (isRequiredArgument(arg) && arg.deprecationReason != null) {\n var _arg$astNode;\n\n context.reportError(\"Required argument @\".concat(directive.name, \"(\").concat(arg.name, \":) cannot be deprecated.\"), [getDeprecatedDirectiveNode(arg.astNode), // istanbul ignore next (TODO need to write coverage tests)\n (_arg$astNode = arg.astNode) === null || _arg$astNode === void 0 ? void 0 : _arg$astNode.type]);\n }\n }\n }\n}\n\nfunction validateName(context, node) {\n // Ensure names are valid, however introspection types opt out.\n var error = isValidNameError(node.name);\n\n if (error) {\n context.addError(locatedError(error, node.astNode));\n }\n}\n\nfunction validateTypes(context) {\n var validateInputObjectCircularRefs = createInputObjectCircularRefsValidator(context);\n var typeMap = context.schema.getTypeMap();\n\n for (var _i8 = 0, _objectValues2 = objectValues(typeMap); _i8 < _objectValues2.length; _i8++) {\n var type = _objectValues2[_i8];\n\n // Ensure all provided types are in fact GraphQL type.\n if (!isNamedType(type)) {\n context.reportError(\"Expected GraphQL named type but got: \".concat(inspect(type), \".\"), type.astNode);\n continue;\n } // Ensure it is named correctly (excluding introspection types).\n\n\n if (!isIntrospectionType(type)) {\n validateName(context, type);\n }\n\n if (isObjectType(type)) {\n // Ensure fields are valid\n validateFields(context, type); // Ensure objects implement the interfaces they claim to.\n\n validateInterfaces(context, type);\n } else if (isInterfaceType(type)) {\n // Ensure fields are valid.\n validateFields(context, type); // Ensure interfaces implement the interfaces they claim to.\n\n validateInterfaces(context, type);\n } else if (isUnionType(type)) {\n // Ensure Unions include valid member types.\n validateUnionMembers(context, type);\n } else if (isEnumType(type)) {\n // Ensure Enums have valid values.\n validateEnumValues(context, type);\n } else if (isInputObjectType(type)) {\n // Ensure Input Object fields are valid.\n validateInputFields(context, type); // Ensure Input Objects do not contain non-nullable circular references\n\n validateInputObjectCircularRefs(type);\n }\n }\n}\n\nfunction validateFields(context, type) {\n var fields = objectValues(type.getFields()); // Objects and Interfaces both must define one or more fields.\n\n if (fields.length === 0) {\n context.reportError(\"Type \".concat(type.name, \" must define one or more fields.\"), getAllNodes(type));\n }\n\n for (var _i10 = 0; _i10 < fields.length; _i10++) {\n var field = fields[_i10];\n // Ensure they are named correctly.\n validateName(context, field); // Ensure the type is an output type\n\n if (!isOutputType(field.type)) {\n var _field$astNode;\n\n context.reportError(\"The type of \".concat(type.name, \".\").concat(field.name, \" must be Output Type \") + \"but got: \".concat(inspect(field.type), \".\"), (_field$astNode = field.astNode) === null || _field$astNode === void 0 ? void 0 : _field$astNode.type);\n } // Ensure the arguments are valid\n\n\n for (var _i12 = 0, _field$args2 = field.args; _i12 < _field$args2.length; _i12++) {\n var arg = _field$args2[_i12];\n var argName = arg.name; // Ensure they are named correctly.\n\n validateName(context, arg); // Ensure the type is an input type\n\n if (!isInputType(arg.type)) {\n var _arg$astNode2;\n\n context.reportError(\"The type of \".concat(type.name, \".\").concat(field.name, \"(\").concat(argName, \":) must be Input \") + \"Type but got: \".concat(inspect(arg.type), \".\"), (_arg$astNode2 = arg.astNode) === null || _arg$astNode2 === void 0 ? void 0 : _arg$astNode2.type);\n }\n\n if (isRequiredArgument(arg) && arg.deprecationReason != null) {\n var _arg$astNode3;\n\n context.reportError(\"Required argument \".concat(type.name, \".\").concat(field.name, \"(\").concat(argName, \":) cannot be deprecated.\"), [getDeprecatedDirectiveNode(arg.astNode), // istanbul ignore next (TODO need to write coverage tests)\n (_arg$astNode3 = arg.astNode) === null || _arg$astNode3 === void 0 ? void 0 : _arg$astNode3.type]);\n }\n }\n }\n}\n\nfunction validateInterfaces(context, type) {\n var ifaceTypeNames = Object.create(null);\n\n for (var _i14 = 0, _type$getInterfaces2 = type.getInterfaces(); _i14 < _type$getInterfaces2.length; _i14++) {\n var iface = _type$getInterfaces2[_i14];\n\n if (!isInterfaceType(iface)) {\n context.reportError(\"Type \".concat(inspect(type), \" must only implement Interface types, \") + \"it cannot implement \".concat(inspect(iface), \".\"), getAllImplementsInterfaceNodes(type, iface));\n continue;\n }\n\n if (type === iface) {\n context.reportError(\"Type \".concat(type.name, \" cannot implement itself because it would create a circular reference.\"), getAllImplementsInterfaceNodes(type, iface));\n continue;\n }\n\n if (ifaceTypeNames[iface.name]) {\n context.reportError(\"Type \".concat(type.name, \" can only implement \").concat(iface.name, \" once.\"), getAllImplementsInterfaceNodes(type, iface));\n continue;\n }\n\n ifaceTypeNames[iface.name] = true;\n validateTypeImplementsAncestors(context, type, iface);\n validateTypeImplementsInterface(context, type, iface);\n }\n}\n\nfunction validateTypeImplementsInterface(context, type, iface) {\n var typeFieldMap = type.getFields(); // Assert each interface field is implemented.\n\n for (var _i16 = 0, _objectValues4 = objectValues(iface.getFields()); _i16 < _objectValues4.length; _i16++) {\n var ifaceField = _objectValues4[_i16];\n var fieldName = ifaceField.name;\n var typeField = typeFieldMap[fieldName]; // Assert interface field exists on type.\n\n if (!typeField) {\n context.reportError(\"Interface field \".concat(iface.name, \".\").concat(fieldName, \" expected but \").concat(type.name, \" does not provide it.\"), [ifaceField.astNode].concat(getAllNodes(type)));\n continue;\n } // Assert interface field type is satisfied by type field type, by being\n // a valid subtype. (covariant)\n\n\n if (!isTypeSubTypeOf(context.schema, typeField.type, ifaceField.type)) {\n var _ifaceField$astNode, _typeField$astNode;\n\n context.reportError(\"Interface field \".concat(iface.name, \".\").concat(fieldName, \" expects type \") + \"\".concat(inspect(ifaceField.type), \" but \").concat(type.name, \".\").concat(fieldName, \" \") + \"is type \".concat(inspect(typeField.type), \".\"), [// istanbul ignore next (TODO need to write coverage tests)\n (_ifaceField$astNode = ifaceField.astNode) === null || _ifaceField$astNode === void 0 ? void 0 : _ifaceField$astNode.type, // istanbul ignore next (TODO need to write coverage tests)\n (_typeField$astNode = typeField.astNode) === null || _typeField$astNode === void 0 ? void 0 : _typeField$astNode.type]);\n } // Assert each interface field arg is implemented.\n\n\n var _loop = function _loop(_i18, _ifaceField$args2) {\n var ifaceArg = _ifaceField$args2[_i18];\n var argName = ifaceArg.name;\n var typeArg = find(typeField.args, function (arg) {\n return arg.name === argName;\n }); // Assert interface field arg exists on object field.\n\n if (!typeArg) {\n context.reportError(\"Interface field argument \".concat(iface.name, \".\").concat(fieldName, \"(\").concat(argName, \":) expected but \").concat(type.name, \".\").concat(fieldName, \" does not provide it.\"), [ifaceArg.astNode, typeField.astNode]);\n return \"continue\";\n } // Assert interface field arg type matches object field arg type.\n // (invariant)\n // TODO: change to contravariant?\n\n\n if (!isEqualType(ifaceArg.type, typeArg.type)) {\n var _ifaceArg$astNode, _typeArg$astNode;\n\n context.reportError(\"Interface field argument \".concat(iface.name, \".\").concat(fieldName, \"(\").concat(argName, \":) \") + \"expects type \".concat(inspect(ifaceArg.type), \" but \") + \"\".concat(type.name, \".\").concat(fieldName, \"(\").concat(argName, \":) is type \") + \"\".concat(inspect(typeArg.type), \".\"), [// istanbul ignore next (TODO need to write coverage tests)\n (_ifaceArg$astNode = ifaceArg.astNode) === null || _ifaceArg$astNode === void 0 ? void 0 : _ifaceArg$astNode.type, // istanbul ignore next (TODO need to write coverage tests)\n (_typeArg$astNode = typeArg.astNode) === null || _typeArg$astNode === void 0 ? void 0 : _typeArg$astNode.type]);\n } // TODO: validate default values?\n\n };\n\n for (var _i18 = 0, _ifaceField$args2 = ifaceField.args; _i18 < _ifaceField$args2.length; _i18++) {\n var _ret = _loop(_i18, _ifaceField$args2);\n\n if (_ret === \"continue\") continue;\n } // Assert additional arguments must not be required.\n\n\n var _loop2 = function _loop2(_i20, _typeField$args2) {\n var typeArg = _typeField$args2[_i20];\n var argName = typeArg.name;\n var ifaceArg = find(ifaceField.args, function (arg) {\n return arg.name === argName;\n });\n\n if (!ifaceArg && isRequiredArgument(typeArg)) {\n context.reportError(\"Object field \".concat(type.name, \".\").concat(fieldName, \" includes required argument \").concat(argName, \" that is missing from the Interface field \").concat(iface.name, \".\").concat(fieldName, \".\"), [typeArg.astNode, ifaceField.astNode]);\n }\n };\n\n for (var _i20 = 0, _typeField$args2 = typeField.args; _i20 < _typeField$args2.length; _i20++) {\n _loop2(_i20, _typeField$args2);\n }\n }\n}\n\nfunction validateTypeImplementsAncestors(context, type, iface) {\n var ifaceInterfaces = type.getInterfaces();\n\n for (var _i22 = 0, _iface$getInterfaces2 = iface.getInterfaces(); _i22 < _iface$getInterfaces2.length; _i22++) {\n var transitive = _iface$getInterfaces2[_i22];\n\n if (ifaceInterfaces.indexOf(transitive) === -1) {\n context.reportError(transitive === type ? \"Type \".concat(type.name, \" cannot implement \").concat(iface.name, \" because it would create a circular reference.\") : \"Type \".concat(type.name, \" must implement \").concat(transitive.name, \" because it is implemented by \").concat(iface.name, \".\"), [].concat(getAllImplementsInterfaceNodes(iface, transitive), getAllImplementsInterfaceNodes(type, iface)));\n }\n }\n}\n\nfunction validateUnionMembers(context, union) {\n var memberTypes = union.getTypes();\n\n if (memberTypes.length === 0) {\n context.reportError(\"Union type \".concat(union.name, \" must define one or more member types.\"), getAllNodes(union));\n }\n\n var includedTypeNames = Object.create(null);\n\n for (var _i24 = 0; _i24 < memberTypes.length; _i24++) {\n var memberType = memberTypes[_i24];\n\n if (includedTypeNames[memberType.name]) {\n context.reportError(\"Union type \".concat(union.name, \" can only include type \").concat(memberType.name, \" once.\"), getUnionMemberTypeNodes(union, memberType.name));\n continue;\n }\n\n includedTypeNames[memberType.name] = true;\n\n if (!isObjectType(memberType)) {\n context.reportError(\"Union type \".concat(union.name, \" can only include Object types, \") + \"it cannot include \".concat(inspect(memberType), \".\"), getUnionMemberTypeNodes(union, String(memberType)));\n }\n }\n}\n\nfunction validateEnumValues(context, enumType) {\n var enumValues = enumType.getValues();\n\n if (enumValues.length === 0) {\n context.reportError(\"Enum type \".concat(enumType.name, \" must define one or more values.\"), getAllNodes(enumType));\n }\n\n for (var _i26 = 0; _i26 < enumValues.length; _i26++) {\n var enumValue = enumValues[_i26];\n var valueName = enumValue.name; // Ensure valid name.\n\n validateName(context, enumValue);\n\n if (valueName === 'true' || valueName === 'false' || valueName === 'null') {\n context.reportError(\"Enum type \".concat(enumType.name, \" cannot include value: \").concat(valueName, \".\"), enumValue.astNode);\n }\n }\n}\n\nfunction validateInputFields(context, inputObj) {\n var fields = objectValues(inputObj.getFields());\n\n if (fields.length === 0) {\n context.reportError(\"Input Object type \".concat(inputObj.name, \" must define one or more fields.\"), getAllNodes(inputObj));\n } // Ensure the arguments are valid\n\n\n for (var _i28 = 0; _i28 < fields.length; _i28++) {\n var field = fields[_i28];\n // Ensure they are named correctly.\n validateName(context, field); // Ensure the type is an input type\n\n if (!isInputType(field.type)) {\n var _field$astNode2;\n\n context.reportError(\"The type of \".concat(inputObj.name, \".\").concat(field.name, \" must be Input Type \") + \"but got: \".concat(inspect(field.type), \".\"), (_field$astNode2 = field.astNode) === null || _field$astNode2 === void 0 ? void 0 : _field$astNode2.type);\n }\n\n if (isRequiredInputField(field) && field.deprecationReason != null) {\n var _field$astNode3;\n\n context.reportError(\"Required input field \".concat(inputObj.name, \".\").concat(field.name, \" cannot be deprecated.\"), [getDeprecatedDirectiveNode(field.astNode), // istanbul ignore next (TODO need to write coverage tests)\n (_field$astNode3 = field.astNode) === null || _field$astNode3 === void 0 ? void 0 : _field$astNode3.type]);\n }\n }\n}\n\nfunction createInputObjectCircularRefsValidator(context) {\n // Modified copy of algorithm from 'src/validation/rules/NoFragmentCycles.js'.\n // Tracks already visited types to maintain O(N) and to ensure that cycles\n // are not redundantly reported.\n var visitedTypes = Object.create(null); // Array of types nodes used to produce meaningful errors\n\n var fieldPath = []; // Position in the type path\n\n var fieldPathIndexByTypeName = Object.create(null);\n return detectCycleRecursive; // This does a straight-forward DFS to find cycles.\n // It does not terminate when a cycle was found but continues to explore\n // the graph to find all possible cycles.\n\n function detectCycleRecursive(inputObj) {\n if (visitedTypes[inputObj.name]) {\n return;\n }\n\n visitedTypes[inputObj.name] = true;\n fieldPathIndexByTypeName[inputObj.name] = fieldPath.length;\n var fields = objectValues(inputObj.getFields());\n\n for (var _i30 = 0; _i30 < fields.length; _i30++) {\n var field = fields[_i30];\n\n if (isNonNullType(field.type) && isInputObjectType(field.type.ofType)) {\n var fieldType = field.type.ofType;\n var cycleIndex = fieldPathIndexByTypeName[fieldType.name];\n fieldPath.push(field);\n\n if (cycleIndex === undefined) {\n detectCycleRecursive(fieldType);\n } else {\n var cyclePath = fieldPath.slice(cycleIndex);\n var pathStr = cyclePath.map(function (fieldObj) {\n return fieldObj.name;\n }).join('.');\n context.reportError(\"Cannot reference Input Object \\\"\".concat(fieldType.name, \"\\\" within itself through a series of non-null fields: \\\"\").concat(pathStr, \"\\\".\"), cyclePath.map(function (fieldObj) {\n return fieldObj.astNode;\n }));\n }\n\n fieldPath.pop();\n }\n }\n\n fieldPathIndexByTypeName[inputObj.name] = undefined;\n }\n}\n\nfunction getAllNodes(object) {\n var astNode = object.astNode,\n extensionASTNodes = object.extensionASTNodes;\n return astNode ? extensionASTNodes ? [astNode].concat(extensionASTNodes) : [astNode] : extensionASTNodes !== null && extensionASTNodes !== void 0 ? extensionASTNodes : [];\n}\n\nfunction getAllSubNodes(object, getter) {\n var subNodes = [];\n\n for (var _i32 = 0, _getAllNodes2 = getAllNodes(object); _i32 < _getAllNodes2.length; _i32++) {\n var _getter;\n\n var node = _getAllNodes2[_i32];\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n subNodes = subNodes.concat((_getter = getter(node)) !== null && _getter !== void 0 ? _getter : []);\n }\n\n return subNodes;\n}\n\nfunction getAllImplementsInterfaceNodes(type, iface) {\n return getAllSubNodes(type, function (typeNode) {\n return typeNode.interfaces;\n }).filter(function (ifaceNode) {\n return ifaceNode.name.value === iface.name;\n });\n}\n\nfunction getUnionMemberTypeNodes(union, typeName) {\n return getAllSubNodes(union, function (unionNode) {\n return unionNode.types;\n }).filter(function (typeNode) {\n return typeNode.name.value === typeName;\n });\n}\n\nfunction getDeprecatedDirectiveNode(definitionNode) {\n var _definitionNode$direc;\n\n // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203')\n return definitionNode === null || definitionNode === void 0 ? void 0 : (_definitionNode$direc = definitionNode.directives) === null || _definitionNode$direc === void 0 ? void 0 : _definitionNode$direc.find(function (node) {\n return node.name.value === GraphQLDeprecatedDirective.name;\n });\n}\n","import inspect from \"../jsutils/inspect.mjs\";\nimport { GraphQLError } from \"./GraphQLError.mjs\";\n/**\n * Given an arbitrary value, presumably thrown while attempting to execute a\n * GraphQL operation, produce a new GraphQLError aware of the location in the\n * document responsible for the original Error.\n */\n\nexport function locatedError(rawOriginalError, nodes, path) {\n var _nodes;\n\n // Sometimes a non-error is thrown, wrap it as an Error instance to ensure a consistent Error interface.\n var originalError = rawOriginalError instanceof Error ? rawOriginalError : new Error('Unexpected error value: ' + inspect(rawOriginalError)); // Note: this uses a brand-check to support GraphQL errors originating from other contexts.\n\n if (Array.isArray(originalError.path)) {\n return originalError;\n }\n\n return new GraphQLError(originalError.message, (_nodes = originalError.nodes) !== null && _nodes !== void 0 ? _nodes : nodes, originalError.source, originalError.positions, path, originalError);\n}\n","import find from \"../polyfills/find.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { isNode } from \"../language/ast.mjs\";\nimport { getVisitFn } from \"../language/visitor.mjs\";\nimport { isObjectType, isInterfaceType, isEnumType, isInputObjectType, isListType, isCompositeType, isInputType, isOutputType, getNullableType, getNamedType } from \"../type/definition.mjs\";\nimport { SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef } from \"../type/introspection.mjs\";\nimport { typeFromAST } from \"./typeFromAST.mjs\";\n/**\n * TypeInfo is a utility class which, given a GraphQL schema, can keep track\n * of the current field and type definitions at any point in a GraphQL document\n * AST during a recursive descent by calling `enter(node)` and `leave(node)`.\n */\n\nexport var TypeInfo = /*#__PURE__*/function () {\n function TypeInfo(schema, // NOTE: this experimental optional second parameter is only needed in order\n // to support non-spec-compliant code bases. You should never need to use it.\n // It may disappear in the future.\n getFieldDefFn, // Initial type may be provided in rare cases to facilitate traversals\n // beginning somewhere other than documents.\n initialType) {\n this._schema = schema;\n this._typeStack = [];\n this._parentTypeStack = [];\n this._inputTypeStack = [];\n this._fieldDefStack = [];\n this._defaultValueStack = [];\n this._directive = null;\n this._argument = null;\n this._enumValue = null;\n this._getFieldDef = getFieldDefFn !== null && getFieldDefFn !== void 0 ? getFieldDefFn : getFieldDef;\n\n if (initialType) {\n if (isInputType(initialType)) {\n this._inputTypeStack.push(initialType);\n }\n\n if (isCompositeType(initialType)) {\n this._parentTypeStack.push(initialType);\n }\n\n if (isOutputType(initialType)) {\n this._typeStack.push(initialType);\n }\n }\n }\n\n var _proto = TypeInfo.prototype;\n\n _proto.getType = function getType() {\n if (this._typeStack.length > 0) {\n return this._typeStack[this._typeStack.length - 1];\n }\n };\n\n _proto.getParentType = function getParentType() {\n if (this._parentTypeStack.length > 0) {\n return this._parentTypeStack[this._parentTypeStack.length - 1];\n }\n };\n\n _proto.getInputType = function getInputType() {\n if (this._inputTypeStack.length > 0) {\n return this._inputTypeStack[this._inputTypeStack.length - 1];\n }\n };\n\n _proto.getParentInputType = function getParentInputType() {\n if (this._inputTypeStack.length > 1) {\n return this._inputTypeStack[this._inputTypeStack.length - 2];\n }\n };\n\n _proto.getFieldDef = function getFieldDef() {\n if (this._fieldDefStack.length > 0) {\n return this._fieldDefStack[this._fieldDefStack.length - 1];\n }\n };\n\n _proto.getDefaultValue = function getDefaultValue() {\n if (this._defaultValueStack.length > 0) {\n return this._defaultValueStack[this._defaultValueStack.length - 1];\n }\n };\n\n _proto.getDirective = function getDirective() {\n return this._directive;\n };\n\n _proto.getArgument = function getArgument() {\n return this._argument;\n };\n\n _proto.getEnumValue = function getEnumValue() {\n return this._enumValue;\n };\n\n _proto.enter = function enter(node) {\n var schema = this._schema; // Note: many of the types below are explicitly typed as \"mixed\" to drop\n // any assumptions of a valid schema to ensure runtime types are properly\n // checked before continuing since TypeInfo is used as part of validation\n // which occurs before guarantees of schema and document validity.\n\n switch (node.kind) {\n case Kind.SELECTION_SET:\n {\n var namedType = getNamedType(this.getType());\n\n this._parentTypeStack.push(isCompositeType(namedType) ? namedType : undefined);\n\n break;\n }\n\n case Kind.FIELD:\n {\n var parentType = this.getParentType();\n var fieldDef;\n var fieldType;\n\n if (parentType) {\n fieldDef = this._getFieldDef(schema, parentType, node);\n\n if (fieldDef) {\n fieldType = fieldDef.type;\n }\n }\n\n this._fieldDefStack.push(fieldDef);\n\n this._typeStack.push(isOutputType(fieldType) ? fieldType : undefined);\n\n break;\n }\n\n case Kind.DIRECTIVE:\n this._directive = schema.getDirective(node.name.value);\n break;\n\n case Kind.OPERATION_DEFINITION:\n {\n var type;\n\n switch (node.operation) {\n case 'query':\n type = schema.getQueryType();\n break;\n\n case 'mutation':\n type = schema.getMutationType();\n break;\n\n case 'subscription':\n type = schema.getSubscriptionType();\n break;\n }\n\n this._typeStack.push(isObjectType(type) ? type : undefined);\n\n break;\n }\n\n case Kind.INLINE_FRAGMENT:\n case Kind.FRAGMENT_DEFINITION:\n {\n var typeConditionAST = node.typeCondition;\n var outputType = typeConditionAST ? typeFromAST(schema, typeConditionAST) : getNamedType(this.getType());\n\n this._typeStack.push(isOutputType(outputType) ? outputType : undefined);\n\n break;\n }\n\n case Kind.VARIABLE_DEFINITION:\n {\n var inputType = typeFromAST(schema, node.type);\n\n this._inputTypeStack.push(isInputType(inputType) ? inputType : undefined);\n\n break;\n }\n\n case Kind.ARGUMENT:\n {\n var _this$getDirective;\n\n var argDef;\n var argType;\n var fieldOrDirective = (_this$getDirective = this.getDirective()) !== null && _this$getDirective !== void 0 ? _this$getDirective : this.getFieldDef();\n\n if (fieldOrDirective) {\n argDef = find(fieldOrDirective.args, function (arg) {\n return arg.name === node.name.value;\n });\n\n if (argDef) {\n argType = argDef.type;\n }\n }\n\n this._argument = argDef;\n\n this._defaultValueStack.push(argDef ? argDef.defaultValue : undefined);\n\n this._inputTypeStack.push(isInputType(argType) ? argType : undefined);\n\n break;\n }\n\n case Kind.LIST:\n {\n var listType = getNullableType(this.getInputType());\n var itemType = isListType(listType) ? listType.ofType : listType; // List positions never have a default value.\n\n this._defaultValueStack.push(undefined);\n\n this._inputTypeStack.push(isInputType(itemType) ? itemType : undefined);\n\n break;\n }\n\n case Kind.OBJECT_FIELD:\n {\n var objectType = getNamedType(this.getInputType());\n var inputFieldType;\n var inputField;\n\n if (isInputObjectType(objectType)) {\n inputField = objectType.getFields()[node.name.value];\n\n if (inputField) {\n inputFieldType = inputField.type;\n }\n }\n\n this._defaultValueStack.push(inputField ? inputField.defaultValue : undefined);\n\n this._inputTypeStack.push(isInputType(inputFieldType) ? inputFieldType : undefined);\n\n break;\n }\n\n case Kind.ENUM:\n {\n var enumType = getNamedType(this.getInputType());\n var enumValue;\n\n if (isEnumType(enumType)) {\n enumValue = enumType.getValue(node.value);\n }\n\n this._enumValue = enumValue;\n break;\n }\n }\n };\n\n _proto.leave = function leave(node) {\n switch (node.kind) {\n case Kind.SELECTION_SET:\n this._parentTypeStack.pop();\n\n break;\n\n case Kind.FIELD:\n this._fieldDefStack.pop();\n\n this._typeStack.pop();\n\n break;\n\n case Kind.DIRECTIVE:\n this._directive = null;\n break;\n\n case Kind.OPERATION_DEFINITION:\n case Kind.INLINE_FRAGMENT:\n case Kind.FRAGMENT_DEFINITION:\n this._typeStack.pop();\n\n break;\n\n case Kind.VARIABLE_DEFINITION:\n this._inputTypeStack.pop();\n\n break;\n\n case Kind.ARGUMENT:\n this._argument = null;\n\n this._defaultValueStack.pop();\n\n this._inputTypeStack.pop();\n\n break;\n\n case Kind.LIST:\n case Kind.OBJECT_FIELD:\n this._defaultValueStack.pop();\n\n this._inputTypeStack.pop();\n\n break;\n\n case Kind.ENUM:\n this._enumValue = null;\n break;\n }\n };\n\n return TypeInfo;\n}();\n/**\n * Not exactly the same as the executor's definition of getFieldDef, in this\n * statically evaluated environment we do not always have an Object type,\n * and need to handle Interface and Union types.\n */\n\nfunction getFieldDef(schema, parentType, fieldNode) {\n var name = fieldNode.name.value;\n\n if (name === SchemaMetaFieldDef.name && schema.getQueryType() === parentType) {\n return SchemaMetaFieldDef;\n }\n\n if (name === TypeMetaFieldDef.name && schema.getQueryType() === parentType) {\n return TypeMetaFieldDef;\n }\n\n if (name === TypeNameMetaFieldDef.name && isCompositeType(parentType)) {\n return TypeNameMetaFieldDef;\n }\n\n if (isObjectType(parentType) || isInterfaceType(parentType)) {\n return parentType.getFields()[name];\n }\n}\n/**\n * Creates a new visitor instance which maintains a provided TypeInfo instance\n * along with visiting visitor.\n */\n\n\nexport function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter: function enter(node) {\n typeInfo.enter(node);\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n false);\n\n if (fn) {\n var result = fn.apply(visitor, arguments);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n leave: function leave(node) {\n var fn = getVisitFn(visitor, node.kind,\n /* isLeaving */\n true);\n var result;\n\n if (fn) {\n result = fn.apply(visitor, arguments);\n }\n\n typeInfo.leave(node);\n return result;\n }\n };\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { SYMBOL_ITERATOR } from \"../polyfills/symbols.mjs\";\n/**\n * Safer version of `Array.from` that return `null` if value isn't convertible to array.\n * Also protects against Array-like objects without items.\n *\n * @example\n *\n * safeArrayFrom([ 1, 2, 3 ]) // [1, 2, 3]\n * safeArrayFrom('ABC') // null\n * safeArrayFrom({ length: 1 }) // null\n * safeArrayFrom({ length: 1, 0: 'Alpha' }) // ['Alpha']\n * safeArrayFrom({ key: 'value' }) // null\n * safeArrayFrom(new Map()) // []\n *\n */\n\nexport default function safeArrayFrom(collection) {\n var mapFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (item) {\n return item;\n };\n\n if (collection == null || _typeof(collection) !== 'object') {\n return null;\n }\n\n if (Array.isArray(collection)) {\n return collection.map(mapFn);\n } // Is Iterable?\n\n\n var iteratorMethod = collection[SYMBOL_ITERATOR];\n\n if (typeof iteratorMethod === 'function') {\n // $FlowFixMe[incompatible-use]\n var iterator = iteratorMethod.call(collection);\n var result = [];\n var step;\n\n for (var i = 0; !(step = iterator.next()).done; ++i) {\n result.push(mapFn(step.value, i));\n }\n\n return result;\n } // Is Array like?\n\n\n var length = collection.length;\n\n if (typeof length === 'number' && length >= 0 && length % 1 === 0) {\n var _result = [];\n\n for (var _i = 0; _i < length; ++_i) {\n if (!Object.prototype.hasOwnProperty.call(collection, _i)) {\n return null;\n }\n\n _result.push(mapFn(collection[String(_i)], _i));\n }\n\n return _result;\n }\n\n return null;\n}\n","import isFinite from \"../polyfills/isFinite.mjs\";\nimport objectValues from \"../polyfills/objectValues.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport safeArrayFrom from \"../jsutils/safeArrayFrom.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { GraphQLID } from \"../type/scalars.mjs\";\nimport { isLeafType, isEnumType, isInputObjectType, isListType, isNonNullType } from \"../type/definition.mjs\";\n/**\n * Produces a GraphQL Value AST given a JavaScript object.\n * Function will match JavaScript/JSON values to GraphQL AST schema format\n * by using suggested GraphQLInputType. For example:\n *\n * astFromValue(\"value\", GraphQLString)\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * JavaScript values.\n *\n * | JSON Value | GraphQL Value |\n * | ------------- | -------------------- |\n * | Object | Input Object |\n * | Array | List |\n * | Boolean | Boolean |\n * | String | String / Enum Value |\n * | Number | Int / Float |\n * | Mixed | Enum Value |\n * | null | NullValue |\n *\n */\n\nexport function astFromValue(value, type) {\n if (isNonNullType(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === Kind.NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: Kind.NULL\n };\n } // undefined\n\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if (isListType(type)) {\n var itemType = type.ofType;\n var items = safeArrayFrom(value);\n\n if (items != null) {\n var valuesNodes = [];\n\n for (var _i2 = 0; _i2 < items.length; _i2++) {\n var item = items[_i2];\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: Kind.LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if (isInputObjectType(type)) {\n if (!isObjectLike(value)) {\n return null;\n }\n\n var fieldNodes = [];\n\n for (var _i4 = 0, _objectValues2 = objectValues(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: Kind.OBJECT_FIELD,\n name: {\n kind: Kind.NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n\n return {\n kind: Kind.OBJECT,\n fields: fieldNodes\n };\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (isLeafType(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: Kind.BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number' && isFinite(serialized)) {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: Kind.INT,\n value: stringNum\n } : {\n kind: Kind.FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (isEnumType(type)) {\n return {\n kind: Kind.ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === GraphQLID && integerStringRegExp.test(serialized)) {\n return {\n kind: Kind.INT,\n value: serialized\n };\n }\n\n return {\n kind: Kind.STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat(inspect(serialized), \".\"));\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || invariant(0, 'Unexpected input type: ' + inspect(type));\n}\n/**\n * IntValue:\n * - NegativeSign? 0\n * - NegativeSign? NonZeroDigit ( Digit+ )?\n */\n\nvar integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/;\n","import { isInterfaceType, isObjectType, isListType, isNonNullType, isAbstractType } from \"../type/definition.mjs\";\n/**\n * Provided two types, return true if the types are equal (invariant).\n */\n\nexport function isEqualType(typeA, typeB) {\n // Equivalent types are equal.\n if (typeA === typeB) {\n return true;\n } // If either type is non-null, the other must also be non-null.\n\n\n if (isNonNullType(typeA) && isNonNullType(typeB)) {\n return isEqualType(typeA.ofType, typeB.ofType);\n } // If either type is a list, the other must also be a list.\n\n\n if (isListType(typeA) && isListType(typeB)) {\n return isEqualType(typeA.ofType, typeB.ofType);\n } // Otherwise the types are not equal.\n\n\n return false;\n}\n/**\n * Provided a type and a super type, return true if the first type is either\n * equal or a subset of the second super type (covariant).\n */\n\nexport function isTypeSubTypeOf(schema, maybeSubType, superType) {\n // Equivalent type is a valid subtype\n if (maybeSubType === superType) {\n return true;\n } // If superType is non-null, maybeSubType must also be non-null.\n\n\n if (isNonNullType(superType)) {\n if (isNonNullType(maybeSubType)) {\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType);\n }\n\n return false;\n }\n\n if (isNonNullType(maybeSubType)) {\n // If superType is nullable, maybeSubType may be non-null or nullable.\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType);\n } // If superType type is a list, maybeSubType type must also be a list.\n\n\n if (isListType(superType)) {\n if (isListType(maybeSubType)) {\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType);\n }\n\n return false;\n }\n\n if (isListType(maybeSubType)) {\n // If superType is not a list, maybeSubType must also be not a list.\n return false;\n } // If superType type is an abstract type, check if it is super type of maybeSubType.\n // Otherwise, the child type is not a valid subtype of the parent type.\n\n\n return isAbstractType(superType) && (isInterfaceType(maybeSubType) || isObjectType(maybeSubType)) && schema.isSubType(superType, maybeSubType);\n}\n/**\n * Provided two composite types, determine if they \"overlap\". Two composite\n * types overlap when the Sets of possible concrete types for each intersect.\n *\n * This is often used to determine if a fragment of a given type could possibly\n * be visited in a context of another type.\n *\n * This function is commutative.\n */\n\nexport function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if (isAbstractType(typeA)) {\n if (isAbstractType(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema.getPossibleTypes(typeA).some(function (type) {\n return schema.isSubType(typeB, type);\n });\n } // Determine if the latter type is a possible concrete type of the former.\n\n\n return schema.isSubType(typeA, typeB);\n }\n\n if (isAbstractType(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isSubType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n\n return false;\n}\n","import inspect from \"../jsutils/inspect.mjs\";\nimport invariant from \"../jsutils/invariant.mjs\";\nimport { Kind } from \"../language/kinds.mjs\";\nimport { GraphQLList, GraphQLNonNull } from \"../type/definition.mjs\";\n/**\n * Given a Schema and an AST node describing a type, return a GraphQLType\n * definition which applies to that type. For example, if provided the parsed\n * AST node for `[User]`, a GraphQLList instance will be returned, containing\n * the type called \"User\" found in the schema. If a type called \"User\" is not\n * found in the schema, then undefined will be returned.\n */\n\n/* eslint-disable no-redeclare */\n\nexport function typeFromAST(schema, typeNode) {\n /* eslint-enable no-redeclare */\n var innerType;\n\n if (typeNode.kind === Kind.LIST_TYPE) {\n innerType = typeFromAST(schema, typeNode.type);\n return innerType && new GraphQLList(innerType);\n }\n\n if (typeNode.kind === Kind.NON_NULL_TYPE) {\n innerType = typeFromAST(schema, typeNode.type);\n return innerType && new GraphQLNonNull(innerType);\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (typeNode.kind === Kind.NAMED_TYPE) {\n return schema.getType(typeNode.name.value);\n } // istanbul ignore next (Not reachable. All possible type nodes have been considered)\n\n\n false || invariant(0, 'Unexpected type node: ' + inspect(typeNode));\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","var getProto = Object.getPrototypeOf ? function(obj) { return Object.getPrototypeOf(obj); } : function(obj) { return obj.__proto__; };\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach(function(key) { def[key] = function() { return value[key]; }; });\n\t}\n\tdef['default'] = function() { return value; };\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"static/js/\" + chunkId + \".\" + {\"15\":\"11913462\",\"80\":\"a852d8b5\",\"142\":\"f2b5b9d2\",\"243\":\"bbde1b63\",\"299\":\"178bb8ae\",\"301\":\"ac028f5d\",\"401\":\"602c1483\",\"461\":\"86214142\",\"474\":\"4d3b6f45\",\"491\":\"3f7e0fe6\",\"492\":\"e5072ce6\",\"554\":\"af0c280d\",\"628\":\"7a5be689\",\"714\":\"717b78d0\",\"822\":\"22307621\",\"904\":\"4b13c79c\",\"925\":\"a41f4405\",\"936\":\"893f5e2e\",\"939\":\"a72fa6b4\",\"950\":\"e1b22d2d\",\"964\":\"9202084e\",\"966\":\"94ffdd6b\",\"986\":\"06a0b739\",\"990\":\"d59bee53\"}[chunkId] + \".chunk.js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var inProgress = {};\nvar dataWebpackPrefix = \"client:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkclient\"] = self[\"webpackChunkclient\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","import * as React from \"react\";\nimport type { History, Location } from \"history\";\nimport { Action as NavigationType } from \"history\";\n\nimport type { RouteMatch } from \"./router\";\n\n/**\n * A Navigator is a \"location changer\"; it's how you get to different locations.\n *\n * Every history instance conforms to the Navigator interface, but the\n * distinction is useful primarily when it comes to the low-level API\n * where both the location and a navigator must be provided separately in order\n * to avoid \"tearing\" that may occur in a suspense-enabled app if the action\n * and/or location were to be read directly from the history instance.\n */\nexport type Navigator = Pick;\n\ninterface NavigationContextObject {\n basename: string;\n navigator: Navigator;\n static: boolean;\n}\n\nexport const NavigationContext = React.createContext(\n null!\n);\n\nif (__DEV__) {\n NavigationContext.displayName = \"Navigation\";\n}\n\ninterface LocationContextObject {\n location: Location;\n navigationType: NavigationType;\n}\n\nexport const LocationContext = React.createContext(\n null!\n);\n\nif (__DEV__) {\n LocationContext.displayName = \"Location\";\n}\n\ninterface RouteContextObject {\n outlet: React.ReactElement | null;\n matches: RouteMatch[];\n}\n\nexport const RouteContext = React.createContext({\n outlet: null,\n matches: [],\n});\n\nif (__DEV__) {\n RouteContext.displayName = \"Route\";\n}\n","import type { Location, Path, To } from \"history\";\nimport { parsePath } from \"history\";\n\nexport function invariant(cond: any, message: string): asserts cond {\n if (!cond) throw new Error(message);\n}\n\nexport function warning(cond: any, message: string): void {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== \"undefined\") console.warn(message);\n\n try {\n // Welcome to debugging React Router!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message);\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n\nconst alreadyWarned: Record = {};\nexport function warningOnce(key: string, cond: boolean, message: string) {\n if (!cond && !alreadyWarned[key]) {\n alreadyWarned[key] = true;\n warning(false, message);\n }\n}\n\ntype ParamParseFailed = { failed: true };\n\ntype ParamParseSegment =\n // Check here if there exists a forward slash in the string.\n Segment extends `${infer LeftSegment}/${infer RightSegment}`\n ? // If there is a forward slash, then attempt to parse each side of the\n // forward slash.\n ParamParseSegment extends infer LeftResult\n ? ParamParseSegment extends infer RightResult\n ? LeftResult extends string\n ? // If the left side is successfully parsed as a param, then check if\n // the right side can be successfully parsed as well. If both sides\n // can be parsed, then the result is a union of the two sides\n // (read: \"foo\" | \"bar\").\n RightResult extends string\n ? LeftResult | RightResult\n : LeftResult\n : // If the left side is not successfully parsed as a param, then check\n // if only the right side can be successfully parse as a param. If it\n // can, then the result is just right, else it's a failure.\n RightResult extends string\n ? RightResult\n : ParamParseFailed\n : ParamParseFailed\n : // If the left side didn't parse into a param, then just check the right\n // side.\n ParamParseSegment extends infer RightResult\n ? RightResult extends string\n ? RightResult\n : ParamParseFailed\n : ParamParseFailed\n : // If there's no forward slash, then check if this segment starts with a\n // colon. If it does, then this is a dynamic segment, so the result is\n // just the remainder of the string. Otherwise, it's a failure.\n Segment extends `:${infer Remaining}`\n ? Remaining\n : ParamParseFailed;\n\n// Attempt to parse the given string segment. If it fails, then just return the\n// plain string type as a default fallback. Otherwise return the union of the\n// parsed string literals that were referenced as dynamic segments in the route.\nexport type ParamParseKey =\n ParamParseSegment extends string\n ? ParamParseSegment\n : string;\n\n/**\n * The parameters that were parsed from the URL path.\n */\nexport type Params = {\n readonly [key in Key]: string | undefined;\n};\n\n/**\n * A route object represents a logical route, with (optionally) its child\n * routes organized in a tree-like structure.\n */\nexport interface RouteObject {\n caseSensitive?: boolean;\n children?: RouteObject[];\n element?: React.ReactNode;\n index?: boolean;\n path?: string;\n}\n\n/**\n * Returns a path with params interpolated.\n *\n * @see https://reactrouter.com/docs/en/v6/api#generatepath\n */\nexport function generatePath(path: string, params: Params = {}): string {\n return path\n .replace(/:(\\w+)/g, (_, key) => {\n invariant(params[key] != null, `Missing \":${key}\" param`);\n return params[key]!;\n })\n .replace(/\\/*\\*$/, (_) =>\n params[\"*\"] == null ? \"\" : params[\"*\"].replace(/^\\/*/, \"/\")\n );\n}\n\n/**\n * A RouteMatch contains info about how a route matched a URL.\n */\nexport interface RouteMatch {\n /**\n * The names and values of dynamic parameters in the URL.\n */\n params: Params;\n /**\n * The portion of the URL pathname that was matched.\n */\n pathname: string;\n /**\n * The portion of the URL pathname that was matched before child routes.\n */\n pathnameBase: string;\n /**\n * The route object that was used to match.\n */\n route: RouteObject;\n}\n\n/**\n * Matches the given routes to a location and returns the match data.\n *\n * @see https://reactrouter.com/docs/en/v6/api#matchroutes\n */\nexport function matchRoutes(\n routes: RouteObject[],\n locationArg: Partial | string,\n basename = \"/\"\n): RouteMatch[] | null {\n let location =\n typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n\n let pathname = stripBasename(location.pathname || \"/\", basename);\n\n if (pathname == null) {\n return null;\n }\n\n let branches = flattenRoutes(routes);\n rankRouteBranches(branches);\n\n let matches = null;\n for (let i = 0; matches == null && i < branches.length; ++i) {\n matches = matchRouteBranch(branches[i], pathname);\n }\n\n return matches;\n}\n\ninterface RouteMeta {\n relativePath: string;\n caseSensitive: boolean;\n childrenIndex: number;\n route: RouteObject;\n}\n\ninterface RouteBranch {\n path: string;\n score: number;\n routesMeta: RouteMeta[];\n}\n\nfunction flattenRoutes(\n routes: RouteObject[],\n branches: RouteBranch[] = [],\n parentsMeta: RouteMeta[] = [],\n parentPath = \"\"\n): RouteBranch[] {\n routes.forEach((route, index) => {\n let meta: RouteMeta = {\n relativePath: route.path || \"\",\n caseSensitive: route.caseSensitive === true,\n childrenIndex: index,\n route,\n };\n\n if (meta.relativePath.startsWith(\"/\")) {\n invariant(\n meta.relativePath.startsWith(parentPath),\n `Absolute route path \"${meta.relativePath}\" nested under path ` +\n `\"${parentPath}\" is not valid. An absolute child route path ` +\n `must start with the combined path of all its parent routes.`\n );\n\n meta.relativePath = meta.relativePath.slice(parentPath.length);\n }\n\n let path = joinPaths([parentPath, meta.relativePath]);\n let routesMeta = parentsMeta.concat(meta);\n\n // Add the children before adding this route to the array so we traverse the\n // route tree depth-first and child routes appear before their parents in\n // the \"flattened\" version.\n if (route.children && route.children.length > 0) {\n invariant(\n route.index !== true,\n `Index routes must not have child routes. Please remove ` +\n `all child routes from route path \"${path}\".`\n );\n\n flattenRoutes(route.children, branches, routesMeta, path);\n }\n\n // Routes without a path shouldn't ever match by themselves unless they are\n // index routes, so don't add them to the list of possible branches.\n if (route.path == null && !route.index) {\n return;\n }\n\n branches.push({ path, score: computeScore(path, route.index), routesMeta });\n });\n\n return branches;\n}\n\nfunction rankRouteBranches(branches: RouteBranch[]): void {\n branches.sort((a, b) =>\n a.score !== b.score\n ? b.score - a.score // Higher score first\n : compareIndexes(\n a.routesMeta.map((meta) => meta.childrenIndex),\n b.routesMeta.map((meta) => meta.childrenIndex)\n )\n );\n}\n\nconst paramRe = /^:\\w+$/;\nconst dynamicSegmentValue = 3;\nconst indexRouteValue = 2;\nconst emptySegmentValue = 1;\nconst staticSegmentValue = 10;\nconst splatPenalty = -2;\nconst isSplat = (s: string) => s === \"*\";\n\nfunction computeScore(path: string, index: boolean | undefined): number {\n let segments = path.split(\"/\");\n let initialScore = segments.length;\n if (segments.some(isSplat)) {\n initialScore += splatPenalty;\n }\n\n if (index) {\n initialScore += indexRouteValue;\n }\n\n return segments\n .filter((s) => !isSplat(s))\n .reduce(\n (score, segment) =>\n score +\n (paramRe.test(segment)\n ? dynamicSegmentValue\n : segment === \"\"\n ? emptySegmentValue\n : staticSegmentValue),\n initialScore\n );\n}\n\nfunction compareIndexes(a: number[], b: number[]): number {\n let siblings =\n a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]);\n\n return siblings\n ? // If two routes are siblings, we should try to match the earlier sibling\n // first. This allows people to have fine-grained control over the matching\n // behavior by simply putting routes with identical paths in the order they\n // want them tried.\n a[a.length - 1] - b[b.length - 1]\n : // Otherwise, it doesn't really make sense to rank non-siblings by index,\n // so they sort equally.\n 0;\n}\n\nfunction matchRouteBranch(\n branch: RouteBranch,\n pathname: string\n): RouteMatch[] | null {\n let { routesMeta } = branch;\n\n let matchedParams = {};\n let matchedPathname = \"/\";\n let matches: RouteMatch[] = [];\n for (let i = 0; i < routesMeta.length; ++i) {\n let meta = routesMeta[i];\n let end = i === routesMeta.length - 1;\n let remainingPathname =\n matchedPathname === \"/\"\n ? pathname\n : pathname.slice(matchedPathname.length) || \"/\";\n let match = matchPath(\n { path: meta.relativePath, caseSensitive: meta.caseSensitive, end },\n remainingPathname\n );\n\n if (!match) return null;\n\n Object.assign(matchedParams, match.params);\n\n let route = meta.route;\n\n matches.push({\n params: matchedParams,\n pathname: joinPaths([matchedPathname, match.pathname]),\n pathnameBase: normalizePathname(\n joinPaths([matchedPathname, match.pathnameBase])\n ),\n route,\n });\n\n if (match.pathnameBase !== \"/\") {\n matchedPathname = joinPaths([matchedPathname, match.pathnameBase]);\n }\n }\n\n return matches;\n}\n\n/**\n * A PathPattern is used to match on some portion of a URL pathname.\n */\nexport interface PathPattern {\n /**\n * A string to match against a URL pathname. May contain `:id`-style segments\n * to indicate placeholders for dynamic parameters. May also end with `/*` to\n * indicate matching the rest of the URL pathname.\n */\n path: Path;\n /**\n * Should be `true` if the static portions of the `path` should be matched in\n * the same case.\n */\n caseSensitive?: boolean;\n /**\n * Should be `true` if this pattern should match the entire URL pathname.\n */\n end?: boolean;\n}\n\n/**\n * A PathMatch contains info about how a PathPattern matched on a URL pathname.\n */\nexport interface PathMatch {\n /**\n * The names and values of dynamic parameters in the URL.\n */\n params: Params;\n /**\n * The portion of the URL pathname that was matched.\n */\n pathname: string;\n /**\n * The portion of the URL pathname that was matched before child routes.\n */\n pathnameBase: string;\n /**\n * The pattern that was used to match.\n */\n pattern: PathPattern;\n}\n\ntype Mutable = {\n -readonly [P in keyof T]: T[P];\n};\n\n/**\n * Performs pattern matching on a URL pathname and returns information about\n * the match.\n *\n * @see https://reactrouter.com/docs/en/v6/api#matchpath\n */\nexport function matchPath<\n ParamKey extends ParamParseKey,\n Path extends string\n>(\n pattern: PathPattern | Path,\n pathname: string\n): PathMatch | null {\n if (typeof pattern === \"string\") {\n pattern = { path: pattern, caseSensitive: false, end: true };\n }\n\n let [matcher, paramNames] = compilePath(\n pattern.path,\n pattern.caseSensitive,\n pattern.end\n );\n\n let match = pathname.match(matcher);\n if (!match) return null;\n\n let matchedPathname = match[0];\n let pathnameBase = matchedPathname.replace(/(.)\\/+$/, \"$1\");\n let captureGroups = match.slice(1);\n let params: Params = paramNames.reduce>(\n (memo, paramName, index) => {\n // We need to compute the pathnameBase here using the raw splat value\n // instead of using params[\"*\"] later because it will be decoded then\n if (paramName === \"*\") {\n let splatValue = captureGroups[index] || \"\";\n pathnameBase = matchedPathname\n .slice(0, matchedPathname.length - splatValue.length)\n .replace(/(.)\\/+$/, \"$1\");\n }\n\n memo[paramName] = safelyDecodeURIComponent(\n captureGroups[index] || \"\",\n paramName\n );\n return memo;\n },\n {}\n );\n\n return {\n params,\n pathname: matchedPathname,\n pathnameBase,\n pattern,\n };\n}\n\nfunction compilePath(\n path: string,\n caseSensitive = false,\n end = true\n): [RegExp, string[]] {\n warning(\n path === \"*\" || !path.endsWith(\"*\") || path.endsWith(\"/*\"),\n `Route path \"${path}\" will be treated as if it were ` +\n `\"${path.replace(/\\*$/, \"/*\")}\" because the \\`*\\` character must ` +\n `always follow a \\`/\\` in the pattern. To get rid of this warning, ` +\n `please change the route path to \"${path.replace(/\\*$/, \"/*\")}\".`\n );\n\n let paramNames: string[] = [];\n let regexpSource =\n \"^\" +\n path\n .replace(/\\/*\\*?$/, \"\") // Ignore trailing / and /*, we'll handle it below\n .replace(/^\\/*/, \"/\") // Make sure it has a leading /\n .replace(/[\\\\.*+^$?{}|()[\\]]/g, \"\\\\$&\") // Escape special regex chars\n .replace(/:(\\w+)/g, (_: string, paramName: string) => {\n paramNames.push(paramName);\n return \"([^\\\\/]+)\";\n });\n\n if (path.endsWith(\"*\")) {\n paramNames.push(\"*\");\n regexpSource +=\n path === \"*\" || path === \"/*\"\n ? \"(.*)$\" // Already matched the initial /, just match the rest\n : \"(?:\\\\/(.+)|\\\\/*)$\"; // Don't include the / in params[\"*\"]\n } else {\n regexpSource += end\n ? \"\\\\/*$\" // When matching to the end, ignore trailing slashes\n : // Otherwise, match a word boundary or a proceeding /. The word boundary restricts\n // parent routes to matching only their own words and nothing more, e.g. parent\n // route \"/home\" should not match \"/home2\".\n // Additionally, allow paths starting with `.`, `-`, `~`, and url-encoded entities,\n // but do not consume the character in the matched path so they can match against\n // nested paths.\n \"(?:(?=[.~-]|%[0-9A-F]{2})|\\\\b|\\\\/|$)\";\n }\n\n let matcher = new RegExp(regexpSource, caseSensitive ? undefined : \"i\");\n\n return [matcher, paramNames];\n}\n\nfunction safelyDecodeURIComponent(value: string, paramName: string) {\n try {\n return decodeURIComponent(value);\n } catch (error) {\n warning(\n false,\n `The value for the URL param \"${paramName}\" will not be decoded because` +\n ` the string \"${value}\" is a malformed URL segment. This is probably` +\n ` due to a bad percent encoding (${error}).`\n );\n\n return value;\n }\n}\n\n/**\n * Returns a resolved path object relative to the given pathname.\n *\n * @see https://reactrouter.com/docs/en/v6/api#resolvepath\n */\nexport function resolvePath(to: To, fromPathname = \"/\"): Path {\n let {\n pathname: toPathname,\n search = \"\",\n hash = \"\",\n } = typeof to === \"string\" ? parsePath(to) : to;\n\n let pathname = toPathname\n ? toPathname.startsWith(\"/\")\n ? toPathname\n : resolvePathname(toPathname, fromPathname)\n : fromPathname;\n\n return {\n pathname,\n search: normalizeSearch(search),\n hash: normalizeHash(hash),\n };\n}\n\nfunction resolvePathname(relativePath: string, fromPathname: string): string {\n let segments = fromPathname.replace(/\\/+$/, \"\").split(\"/\");\n let relativeSegments = relativePath.split(\"/\");\n\n relativeSegments.forEach((segment) => {\n if (segment === \"..\") {\n // Keep the root \"\" segment so the pathname starts at /\n if (segments.length > 1) segments.pop();\n } else if (segment !== \".\") {\n segments.push(segment);\n }\n });\n\n return segments.length > 1 ? segments.join(\"/\") : \"/\";\n}\n\nexport function resolveTo(\n toArg: To,\n routePathnames: string[],\n locationPathname: string\n): Path {\n let to = typeof toArg === \"string\" ? parsePath(toArg) : toArg;\n let toPathname = toArg === \"\" || to.pathname === \"\" ? \"/\" : to.pathname;\n\n // If a pathname is explicitly provided in `to`, it should be relative to the\n // route context. This is explained in `Note on `` values` in our\n // migration guide from v5 as a means of disambiguation between `to` values\n // that begin with `/` and those that do not. However, this is problematic for\n // `to` values that do not provide a pathname. `to` can simply be a search or\n // hash string, in which case we should assume that the navigation is relative\n // to the current location's pathname and *not* the route pathname.\n let from: string;\n if (toPathname == null) {\n from = locationPathname;\n } else {\n let routePathnameIndex = routePathnames.length - 1;\n\n if (toPathname.startsWith(\"..\")) {\n let toSegments = toPathname.split(\"/\");\n\n // Each leading .. segment means \"go up one route\" instead of \"go up one\n // URL segment\". This is a key difference from how works and a\n // major reason we call this a \"to\" value instead of a \"href\".\n while (toSegments[0] === \"..\") {\n toSegments.shift();\n routePathnameIndex -= 1;\n }\n\n to.pathname = toSegments.join(\"/\");\n }\n\n // If there are more \"..\" segments than parent routes, resolve relative to\n // the root / URL.\n from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : \"/\";\n }\n\n let path = resolvePath(to, from);\n\n // Ensure the pathname has a trailing slash if the original to value had one.\n if (\n toPathname &&\n toPathname !== \"/\" &&\n toPathname.endsWith(\"/\") &&\n !path.pathname.endsWith(\"/\")\n ) {\n path.pathname += \"/\";\n }\n\n return path;\n}\n\nexport function getToPathname(to: To): string | undefined {\n // Empty strings should be treated the same as / paths\n return to === \"\" || (to as Path).pathname === \"\"\n ? \"/\"\n : typeof to === \"string\"\n ? parsePath(to).pathname\n : to.pathname;\n}\n\nexport function stripBasename(\n pathname: string,\n basename: string\n): string | null {\n if (basename === \"/\") return pathname;\n\n if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {\n return null;\n }\n\n let nextChar = pathname.charAt(basename.length);\n if (nextChar && nextChar !== \"/\") {\n // pathname does not start with basename/\n return null;\n }\n\n return pathname.slice(basename.length) || \"/\";\n}\n\nexport const joinPaths = (paths: string[]): string =>\n paths.join(\"/\").replace(/\\/\\/+/g, \"/\");\n\nexport const normalizePathname = (pathname: string): string =>\n pathname.replace(/\\/+$/, \"\").replace(/^\\/*/, \"/\");\n\nconst normalizeSearch = (search: string): string =>\n !search || search === \"?\"\n ? \"\"\n : search.startsWith(\"?\")\n ? search\n : \"?\" + search;\n\nconst normalizeHash = (hash: string): string =>\n !hash || hash === \"#\" ? \"\" : hash.startsWith(\"#\") ? hash : \"#\" + hash;\n","import * as React from \"react\";\nimport type { Location, Path, To } from \"history\";\nimport { Action as NavigationType, parsePath } from \"history\";\n\nimport { LocationContext, NavigationContext, RouteContext } from \"./context\";\nimport type {\n ParamParseKey,\n Params,\n PathMatch,\n PathPattern,\n RouteMatch,\n RouteObject,\n} from \"./router\";\nimport {\n getToPathname,\n invariant,\n joinPaths,\n matchPath,\n matchRoutes,\n resolveTo,\n warning,\n warningOnce,\n} from \"./router\";\n\n/**\n * Returns the full href for the given \"to\" value. This is useful for building\n * custom links that are also accessible and preserve right-click behavior.\n *\n * @see https://reactrouter.com/docs/en/v6/api#usehref\n */\nexport function useHref(to: To): string {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useHref() may be used only in the context of a component.`\n );\n\n let { basename, navigator } = React.useContext(NavigationContext);\n let { hash, pathname, search } = useResolvedPath(to);\n\n let joinedPathname = pathname;\n if (basename !== \"/\") {\n let toPathname = getToPathname(to);\n let endsWithSlash = toPathname != null && toPathname.endsWith(\"/\");\n joinedPathname =\n pathname === \"/\"\n ? basename + (endsWithSlash ? \"/\" : \"\")\n : joinPaths([basename, pathname]);\n }\n\n return navigator.createHref({ pathname: joinedPathname, search, hash });\n}\n\n/**\n * Returns true if this component is a descendant of a .\n *\n * @see https://reactrouter.com/docs/en/v6/api#useinroutercontext\n */\nexport function useInRouterContext(): boolean {\n return React.useContext(LocationContext) != null;\n}\n\n/**\n * Returns the current location object, which represents the current URL in web\n * browsers.\n *\n * Note: If you're using this it may mean you're doing some of your own\n * \"routing\" in your app, and we'd like to know what your use case is. We may\n * be able to provide something higher-level to better suit your needs.\n *\n * @see https://reactrouter.com/docs/en/v6/api#uselocation\n */\nexport function useLocation(): Location {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useLocation() may be used only in the context of a component.`\n );\n\n return React.useContext(LocationContext).location;\n}\n\n/**\n * Returns the current navigation action which describes how the router came to\n * the current location, either by a pop, push, or replace on the history stack.\n *\n * @see https://reactrouter.com/docs/en/v6/api#usenavigationtype\n */\nexport function useNavigationType(): NavigationType {\n return React.useContext(LocationContext).navigationType;\n}\n\n/**\n * Returns true if the URL for the given \"to\" value matches the current URL.\n * This is useful for components that need to know \"active\" state, e.g.\n * .\n *\n * @see https://reactrouter.com/docs/en/v6/api#usematch\n */\nexport function useMatch<\n ParamKey extends ParamParseKey,\n Path extends string\n>(pattern: PathPattern | Path): PathMatch | null {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useMatch() may be used only in the context of a component.`\n );\n\n let { pathname } = useLocation();\n return React.useMemo(\n () => matchPath(pattern, pathname),\n [pathname, pattern]\n );\n}\n\n/**\n * The interface for the navigate() function returned from useNavigate().\n */\nexport interface NavigateFunction {\n (to: To, options?: NavigateOptions): void;\n (delta: number): void;\n}\n\nexport interface NavigateOptions {\n replace?: boolean;\n state?: any;\n}\n\n/**\n * Returns an imperative method for changing the location. Used by s, but\n * may also be used by other elements to change the location.\n *\n * @see https://reactrouter.com/docs/en/v6/api#usenavigate\n */\nexport function useNavigate(): NavigateFunction {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useNavigate() may be used only in the context of a component.`\n );\n\n let { basename, navigator } = React.useContext(NavigationContext);\n let { matches } = React.useContext(RouteContext);\n let { pathname: locationPathname } = useLocation();\n\n let routePathnamesJson = JSON.stringify(\n matches.map((match) => match.pathnameBase)\n );\n\n let activeRef = React.useRef(false);\n React.useEffect(() => {\n activeRef.current = true;\n });\n\n let navigate: NavigateFunction = React.useCallback(\n (to: To | number, options: NavigateOptions = {}) => {\n warning(\n activeRef.current,\n `You should call navigate() in a React.useEffect(), not when ` +\n `your component is first rendered.`\n );\n\n if (!activeRef.current) return;\n\n if (typeof to === \"number\") {\n navigator.go(to);\n return;\n }\n\n let path = resolveTo(\n to,\n JSON.parse(routePathnamesJson),\n locationPathname\n );\n\n if (basename !== \"/\") {\n path.pathname = joinPaths([basename, path.pathname]);\n }\n\n (!!options.replace ? navigator.replace : navigator.push)(\n path,\n options.state\n );\n },\n [basename, navigator, routePathnamesJson, locationPathname]\n );\n\n return navigate;\n}\n\nconst OutletContext = React.createContext(null);\n\n/**\n * Returns the context (if provided) for the child route at this level of the route\n * hierarchy.\n * @see https://reactrouter.com/docs/en/v6/api#useoutletcontext\n */\nexport function useOutletContext(): Context {\n return React.useContext(OutletContext) as Context;\n}\n\n/**\n * Returns the element for the child route at this level of the route\n * hierarchy. Used internally by to render child routes.\n *\n * @see https://reactrouter.com/docs/en/v6/api#useoutlet\n */\nexport function useOutlet(context?: unknown): React.ReactElement | null {\n let outlet = React.useContext(RouteContext).outlet;\n if (outlet) {\n return (\n {outlet}\n );\n }\n return outlet;\n}\n\n/**\n * Returns an object of key/value pairs of the dynamic params from the current\n * URL that were matched by the route path.\n *\n * @see https://reactrouter.com/docs/en/v6/api#useparams\n */\nexport function useParams<\n ParamsOrKey extends string | Record = string\n>(): Readonly<\n [ParamsOrKey] extends [string] ? Params : Partial\n> {\n let { matches } = React.useContext(RouteContext);\n let routeMatch = matches[matches.length - 1];\n return routeMatch ? (routeMatch.params as any) : {};\n}\n\n/**\n * Resolves the pathname of the given `to` value against the current location.\n *\n * @see https://reactrouter.com/docs/en/v6/api#useresolvedpath\n */\nexport function useResolvedPath(to: To): Path {\n let { matches } = React.useContext(RouteContext);\n let { pathname: locationPathname } = useLocation();\n\n let routePathnamesJson = JSON.stringify(\n matches.map((match) => match.pathnameBase)\n );\n\n return React.useMemo(\n () => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname),\n [to, routePathnamesJson, locationPathname]\n );\n}\n\n/**\n * Returns the element of the route that matched the current location, prepared\n * with the correct context to render the remainder of the route tree. Route\n * elements in the tree must render an to render their child route's\n * element.\n *\n * @see https://reactrouter.com/docs/en/v6/api#useroutes\n */\nexport function useRoutes(\n routes: RouteObject[],\n locationArg?: Partial | string\n): React.ReactElement | null {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of the\n // router loaded. We can help them understand how to avoid that.\n `useRoutes() may be used only in the context of a component.`\n );\n\n let { matches: parentMatches } = React.useContext(RouteContext);\n let routeMatch = parentMatches[parentMatches.length - 1];\n let parentParams = routeMatch ? routeMatch.params : {};\n let parentPathname = routeMatch ? routeMatch.pathname : \"/\";\n let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : \"/\";\n let parentRoute = routeMatch && routeMatch.route;\n\n if (__DEV__) {\n // You won't get a warning about 2 different under a \n // without a trailing *, but this is a best-effort warning anyway since we\n // cannot even give the warning unless they land at the parent route.\n //\n // Example:\n //\n // \n // {/* This route path MUST end with /* because otherwise\n // it will never match /blog/post/123 */}\n // } />\n // } />\n // \n //\n // function Blog() {\n // return (\n // \n // } />\n // \n // );\n // }\n let parentPath = (parentRoute && parentRoute.path) || \"\";\n warningOnce(\n parentPathname,\n !parentRoute || parentPath.endsWith(\"*\"),\n `You rendered descendant (or called \\`useRoutes()\\`) at ` +\n `\"${parentPathname}\" (under ) but the ` +\n `parent route path has no trailing \"*\". This means if you navigate ` +\n `deeper, the parent won't match anymore and therefore the child ` +\n `routes will never render.\\n\\n` +\n `Please change the parent to .`\n );\n }\n\n let locationFromContext = useLocation();\n\n let location;\n if (locationArg) {\n let parsedLocationArg =\n typeof locationArg === \"string\" ? parsePath(locationArg) : locationArg;\n\n invariant(\n parentPathnameBase === \"/\" ||\n parsedLocationArg.pathname?.startsWith(parentPathnameBase),\n `When overriding the location using \\`\\` or \\`useRoutes(routes, location)\\`, ` +\n `the location pathname must begin with the portion of the URL pathname that was ` +\n `matched by all parent routes. The current pathname base is \"${parentPathnameBase}\" ` +\n `but pathname \"${parsedLocationArg.pathname}\" was given in the \\`location\\` prop.`\n );\n\n location = parsedLocationArg;\n } else {\n location = locationFromContext;\n }\n\n let pathname = location.pathname || \"/\";\n let remainingPathname =\n parentPathnameBase === \"/\"\n ? pathname\n : pathname.slice(parentPathnameBase.length) || \"/\";\n let matches = matchRoutes(routes, { pathname: remainingPathname });\n\n if (__DEV__) {\n warning(\n parentRoute || matches != null,\n `No routes matched location \"${location.pathname}${location.search}${location.hash}\" `\n );\n\n warning(\n matches == null ||\n matches[matches.length - 1].route.element !== undefined,\n `Matched leaf route at location \"${location.pathname}${location.search}${location.hash}\" does not have an element. ` +\n `This means it will render an with a null value by default resulting in an \"empty\" page.`\n );\n }\n\n return _renderMatches(\n matches &&\n matches.map((match) =>\n Object.assign({}, match, {\n params: Object.assign({}, parentParams, match.params),\n pathname: joinPaths([parentPathnameBase, match.pathname]),\n pathnameBase:\n match.pathnameBase === \"/\"\n ? parentPathnameBase\n : joinPaths([parentPathnameBase, match.pathnameBase]),\n })\n ),\n parentMatches\n );\n}\n\nexport function _renderMatches(\n matches: RouteMatch[] | null,\n parentMatches: RouteMatch[] = []\n): React.ReactElement | null {\n if (matches == null) return null;\n\n return matches.reduceRight((outlet, match, index) => {\n return (\n \n );\n }, null as React.ReactElement | null);\n}\n","import * as React from \"react\";\nimport type { InitialEntry, Location, MemoryHistory, To } from \"history\";\nimport {\n Action as NavigationType,\n createMemoryHistory,\n parsePath,\n} from \"history\";\n\nimport { LocationContext, NavigationContext, Navigator } from \"./context\";\nimport {\n useInRouterContext,\n useNavigate,\n useOutlet,\n useRoutes,\n _renderMatches,\n} from \"./hooks\";\nimport type { RouteMatch, RouteObject } from \"./router\";\nimport { invariant, normalizePathname, stripBasename, warning } from \"./router\";\n\nexport interface MemoryRouterProps {\n basename?: string;\n children?: React.ReactNode;\n initialEntries?: InitialEntry[];\n initialIndex?: number;\n}\n\n/**\n * A that stores all entries in memory.\n *\n * @see https://reactrouter.com/docs/en/v6/api#memoryrouter\n */\nexport function MemoryRouter({\n basename,\n children,\n initialEntries,\n initialIndex,\n}: MemoryRouterProps): React.ReactElement {\n let historyRef = React.useRef();\n if (historyRef.current == null) {\n historyRef.current = createMemoryHistory({ initialEntries, initialIndex });\n }\n\n let history = historyRef.current;\n let [state, setState] = React.useState({\n action: history.action,\n location: history.location,\n });\n\n React.useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n \n );\n}\n\nexport interface NavigateProps {\n to: To;\n replace?: boolean;\n state?: any;\n}\n\n/**\n * Changes the current location.\n *\n * Note: This API is mostly useful in React.Component subclasses that are not\n * able to use hooks. In functional components, we recommend you use the\n * `useNavigate` hook instead.\n *\n * @see https://reactrouter.com/docs/en/v6/api#navigate\n */\nexport function Navigate({ to, replace, state }: NavigateProps): null {\n invariant(\n useInRouterContext(),\n // TODO: This error is probably because they somehow have 2 versions of\n // the router loaded. We can help them understand how to avoid that.\n ` may be used only in the context of a component.`\n );\n\n warning(\n !React.useContext(NavigationContext).static,\n ` must not be used on the initial render in a . ` +\n `This is a no-op, but you should modify your code so the is ` +\n `only ever rendered in response to some user interaction or state change.`\n );\n\n let navigate = useNavigate();\n React.useEffect(() => {\n navigate(to, { replace, state });\n });\n\n return null;\n}\n\nexport interface OutletProps {\n context?: unknown;\n}\n\n/**\n * Renders the child route's element, if there is one.\n *\n * @see https://reactrouter.com/docs/en/v6/api#outlet\n */\nexport function Outlet(props: OutletProps): React.ReactElement | null {\n return useOutlet(props.context);\n}\n\nexport interface RouteProps {\n caseSensitive?: boolean;\n children?: React.ReactNode;\n element?: React.ReactNode | null;\n index?: boolean;\n path?: string;\n}\n\nexport interface PathRouteProps {\n caseSensitive?: boolean;\n children?: React.ReactNode;\n element?: React.ReactNode | null;\n index?: false;\n path: string;\n}\n\nexport interface LayoutRouteProps {\n children?: React.ReactNode;\n element?: React.ReactNode | null;\n}\n\nexport interface IndexRouteProps {\n element?: React.ReactNode | null;\n index: true;\n}\n\n/**\n * Declares an element that should be rendered at a certain URL path.\n *\n * @see https://reactrouter.com/docs/en/v6/api#route\n */\nexport function Route(\n _props: PathRouteProps | LayoutRouteProps | IndexRouteProps\n): React.ReactElement | null {\n invariant(\n false,\n `A is only ever to be used as the child of element, ` +\n `never rendered directly. Please wrap your in a .`\n );\n}\n\nexport interface RouterProps {\n basename?: string;\n children?: React.ReactNode;\n location: Partial | string;\n navigationType?: NavigationType;\n navigator: Navigator;\n static?: boolean;\n}\n\n/**\n * Provides location context for the rest of the app.\n *\n * Note: You usually won't render a directly. Instead, you'll render a\n * router that is more specific to your environment such as a \n * in web browsers or a for server rendering.\n *\n * @see https://reactrouter.com/docs/en/v6/api#router\n */\nexport function Router({\n basename: basenameProp = \"/\",\n children = null,\n location: locationProp,\n navigationType = NavigationType.Pop,\n navigator,\n static: staticProp = false,\n}: RouterProps): React.ReactElement | null {\n invariant(\n !useInRouterContext(),\n `You cannot render a inside another .` +\n ` You should never have more than one in your app.`\n );\n\n let basename = normalizePathname(basenameProp);\n let navigationContext = React.useMemo(\n () => ({ basename, navigator, static: staticProp }),\n [basename, navigator, staticProp]\n );\n\n if (typeof locationProp === \"string\") {\n locationProp = parsePath(locationProp);\n }\n\n let {\n pathname = \"/\",\n search = \"\",\n hash = \"\",\n state = null,\n key = \"default\",\n } = locationProp;\n\n let location = React.useMemo(() => {\n let trailingPathname = stripBasename(pathname, basename);\n\n if (trailingPathname == null) {\n return null;\n }\n\n return {\n pathname: trailingPathname,\n search,\n hash,\n state,\n key,\n };\n }, [basename, pathname, search, hash, state, key]);\n\n warning(\n location != null,\n ` is not able to match the URL ` +\n `\"${pathname}${search}${hash}\" because it does not start with the ` +\n `basename, so the won't render anything.`\n );\n\n if (location == null) {\n return null;\n }\n\n return (\n \n \n \n );\n}\n\nexport interface RoutesProps {\n children?: React.ReactNode;\n location?: Partial | string;\n}\n\n/**\n * A container for a nested tree of elements that renders the branch\n * that best matches the current location.\n *\n * @see https://reactrouter.com/docs/en/v6/api#routes\n */\nexport function Routes({\n children,\n location,\n}: RoutesProps): React.ReactElement | null {\n return useRoutes(createRoutesFromChildren(children), location);\n}\n\n///////////////////////////////////////////////////////////////////////////////\n// UTILS\n///////////////////////////////////////////////////////////////////////////////\n\n/**\n * Creates a route config from a React \"children\" object, which is usually\n * either a `` element or an array of them. Used internally by\n * `` to create a route config from its children.\n *\n * @see https://reactrouter.com/docs/en/v6/api#createroutesfromchildren\n */\nexport function createRoutesFromChildren(\n children: React.ReactNode\n): RouteObject[] {\n let routes: RouteObject[] = [];\n\n React.Children.forEach(children, (element) => {\n if (!React.isValidElement(element)) {\n // Ignore non-elements. This allows people to more easily inline\n // conditionals in their route config.\n return;\n }\n\n if (element.type === React.Fragment) {\n // Transparently support React.Fragment and its children.\n routes.push.apply(\n routes,\n createRoutesFromChildren(element.props.children)\n );\n return;\n }\n\n invariant(\n element.type === Route,\n `[${\n typeof element.type === \"string\" ? element.type : element.type.name\n }] is not a component. All component children of must be a or `\n );\n\n let route: RouteObject = {\n caseSensitive: element.props.caseSensitive,\n element: element.props.element,\n index: element.props.index,\n path: element.props.path,\n };\n\n if (element.props.children) {\n route.children = createRoutesFromChildren(element.props.children);\n }\n\n routes.push(route);\n });\n\n return routes;\n}\n\n/**\n * Renders the result of `matchRoutes()` into a React element.\n */\nexport function renderMatches(\n matches: RouteMatch[] | null\n): React.ReactElement | null {\n return _renderMatches(matches);\n}\n","/**\n * NOTE: If you refactor this to split up the modules into separate files,\n * you'll need to update the rollup config for react-router-dom-v5-compat.\n */\nimport * as React from \"react\";\nimport type { BrowserHistory, HashHistory, History } from \"history\";\nimport { createBrowserHistory, createHashHistory } from \"history\";\nimport {\n MemoryRouter,\n Navigate,\n Outlet,\n Route,\n Router,\n Routes,\n createRoutesFromChildren,\n generatePath,\n matchRoutes,\n matchPath,\n createPath,\n parsePath,\n resolvePath,\n renderMatches,\n useHref,\n useInRouterContext,\n useLocation,\n useMatch,\n useNavigate,\n useNavigationType,\n useOutlet,\n useParams,\n useResolvedPath,\n useRoutes,\n useOutletContext,\n} from \"react-router\";\nimport type { To } from \"react-router\";\n\nfunction warning(cond: boolean, message: string): void {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== \"undefined\") console.warn(message);\n\n try {\n // Welcome to debugging React Router!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message);\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// RE-EXPORTS\n////////////////////////////////////////////////////////////////////////////////\n\n// Note: Keep in sync with react-router exports!\nexport {\n MemoryRouter,\n Navigate,\n Outlet,\n Route,\n Router,\n Routes,\n createRoutesFromChildren,\n generatePath,\n matchRoutes,\n matchPath,\n createPath,\n parsePath,\n renderMatches,\n resolvePath,\n useHref,\n useInRouterContext,\n useLocation,\n useMatch,\n useNavigate,\n useNavigationType,\n useOutlet,\n useParams,\n useResolvedPath,\n useRoutes,\n useOutletContext,\n};\n\nexport { NavigationType } from \"react-router\";\nexport type {\n Hash,\n Location,\n Path,\n To,\n MemoryRouterProps,\n NavigateFunction,\n NavigateOptions,\n NavigateProps,\n Navigator,\n OutletProps,\n Params,\n PathMatch,\n RouteMatch,\n RouteObject,\n RouteProps,\n PathRouteProps,\n LayoutRouteProps,\n IndexRouteProps,\n RouterProps,\n Pathname,\n Search,\n RoutesProps,\n} from \"react-router\";\n\n///////////////////////////////////////////////////////////////////////////////\n// DANGER! PLEASE READ ME!\n// We provide these exports as an escape hatch in the event that you need any\n// routing data that we don't provide an explicit API for. With that said, we\n// want to cover your use case if we can, so if you feel the need to use these\n// we want to hear from you. Let us know what you're building and we'll do our\n// best to make sure we can support you!\n//\n// We consider these exports an implementation detail and do not guarantee\n// against any breaking changes, regardless of the semver release. Use with\n// extreme caution and only if you understand the consequences. Godspeed.\n///////////////////////////////////////////////////////////////////////////////\n\n/** @internal */\nexport {\n UNSAFE_NavigationContext,\n UNSAFE_LocationContext,\n UNSAFE_RouteContext,\n} from \"react-router\";\n\n////////////////////////////////////////////////////////////////////////////////\n// COMPONENTS\n////////////////////////////////////////////////////////////////////////////////\n\nexport interface BrowserRouterProps {\n basename?: string;\n children?: React.ReactNode;\n window?: Window;\n}\n\n/**\n * A `` for use in web browsers. Provides the cleanest URLs.\n */\nexport function BrowserRouter({\n basename,\n children,\n window,\n}: BrowserRouterProps) {\n let historyRef = React.useRef();\n if (historyRef.current == null) {\n historyRef.current = createBrowserHistory({ window });\n }\n\n let history = historyRef.current;\n let [state, setState] = React.useState({\n action: history.action,\n location: history.location,\n });\n\n React.useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n \n );\n}\n\nexport interface HashRouterProps {\n basename?: string;\n children?: React.ReactNode;\n window?: Window;\n}\n\n/**\n * A `` for use in web browsers. Stores the location in the hash\n * portion of the URL so it is not sent to the server.\n */\nexport function HashRouter({ basename, children, window }: HashRouterProps) {\n let historyRef = React.useRef();\n if (historyRef.current == null) {\n historyRef.current = createHashHistory({ window });\n }\n\n let history = historyRef.current;\n let [state, setState] = React.useState({\n action: history.action,\n location: history.location,\n });\n\n React.useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n \n );\n}\n\nexport interface HistoryRouterProps {\n basename?: string;\n children?: React.ReactNode;\n history: History;\n}\n\n/**\n * A `` that accepts a pre-instantiated history object. It's important\n * to note that using your own history object is highly discouraged and may add\n * two versions of the history library to your bundles unless you use the same\n * version of the history library that React Router uses internally.\n */\nfunction HistoryRouter({ basename, children, history }: HistoryRouterProps) {\n const [state, setState] = React.useState({\n action: history.action,\n location: history.location,\n });\n\n React.useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n \n );\n}\n\nif (__DEV__) {\n HistoryRouter.displayName = \"unstable_HistoryRouter\";\n}\n\nexport { HistoryRouter as unstable_HistoryRouter };\n\nfunction isModifiedEvent(event: React.MouseEvent) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\n\nexport interface LinkProps\n extends Omit, \"href\"> {\n reloadDocument?: boolean;\n replace?: boolean;\n state?: any;\n to: To;\n}\n\n/**\n * The public API for rendering a history-aware .\n */\nexport const Link = React.forwardRef(\n function LinkWithRef(\n { onClick, reloadDocument, replace = false, state, target, to, ...rest },\n ref\n ) {\n let href = useHref(to);\n let internalOnClick = useLinkClickHandler(to, { replace, state, target });\n function handleClick(\n event: React.MouseEvent\n ) {\n if (onClick) onClick(event);\n if (!event.defaultPrevented && !reloadDocument) {\n internalOnClick(event);\n }\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/anchor-has-content\n \n );\n }\n);\n\nif (__DEV__) {\n Link.displayName = \"Link\";\n}\n\nexport interface NavLinkProps\n extends Omit {\n children?:\n | React.ReactNode\n | ((props: { isActive: boolean }) => React.ReactNode);\n caseSensitive?: boolean;\n className?: string | ((props: { isActive: boolean }) => string | undefined);\n end?: boolean;\n style?:\n | React.CSSProperties\n | ((props: { isActive: boolean }) => React.CSSProperties);\n}\n\n/**\n * A wrapper that knows if it's \"active\" or not.\n */\nexport const NavLink = React.forwardRef(\n function NavLinkWithRef(\n {\n \"aria-current\": ariaCurrentProp = \"page\",\n caseSensitive = false,\n className: classNameProp = \"\",\n end = false,\n style: styleProp,\n to,\n children,\n ...rest\n },\n ref\n ) {\n let location = useLocation();\n let path = useResolvedPath(to);\n\n let locationPathname = location.pathname;\n let toPathname = path.pathname;\n if (!caseSensitive) {\n locationPathname = locationPathname.toLowerCase();\n toPathname = toPathname.toLowerCase();\n }\n\n let isActive =\n locationPathname === toPathname ||\n (!end &&\n locationPathname.startsWith(toPathname) &&\n locationPathname.charAt(toPathname.length) === \"/\");\n\n let ariaCurrent = isActive ? ariaCurrentProp : undefined;\n\n let className: string | undefined;\n if (typeof classNameProp === \"function\") {\n className = classNameProp({ isActive });\n } else {\n // If the className prop is not a function, we use a default `active`\n // class for s that are active. In v5 `active` was the default\n // value for `activeClassName`, but we are removing that API and can still\n // use the old default behavior for a cleaner upgrade path and keep the\n // simple styling rules working as they currently do.\n className = [classNameProp, isActive ? \"active\" : null]\n .filter(Boolean)\n .join(\" \");\n }\n\n let style =\n typeof styleProp === \"function\" ? styleProp({ isActive }) : styleProp;\n\n return (\n \n {typeof children === \"function\" ? children({ isActive }) : children}\n \n );\n }\n);\n\nif (__DEV__) {\n NavLink.displayName = \"NavLink\";\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// HOOKS\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Handles the click behavior for router `` components. This is useful if\n * you need to create custom `` components with the same click behavior we\n * use in our exported ``.\n */\nexport function useLinkClickHandler(\n to: To,\n {\n target,\n replace: replaceProp,\n state,\n }: {\n target?: React.HTMLAttributeAnchorTarget;\n replace?: boolean;\n state?: any;\n } = {}\n): (event: React.MouseEvent) => void {\n let navigate = useNavigate();\n let location = useLocation();\n let path = useResolvedPath(to);\n\n return React.useCallback(\n (event: React.MouseEvent) => {\n if (\n event.button === 0 && // Ignore everything but left clicks\n (!target || target === \"_self\") && // Let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // Ignore clicks with modifier keys\n ) {\n event.preventDefault();\n\n // If the URL hasn't changed, a regular will do a replace instead of\n // a push, so do the same here.\n let replace =\n !!replaceProp || createPath(location) === createPath(path);\n\n navigate(to, { replace, state });\n }\n },\n [location, navigate, path, replaceProp, state, target, to]\n );\n}\n\n/**\n * A convenient wrapper for reading and writing search parameters via the\n * URLSearchParams interface.\n */\nexport function useSearchParams(defaultInit?: URLSearchParamsInit) {\n warning(\n typeof URLSearchParams !== \"undefined\",\n `You cannot use the \\`useSearchParams\\` hook in a browser that does not ` +\n `support the URLSearchParams API. If you need to support Internet ` +\n `Explorer 11, we recommend you load a polyfill such as ` +\n `https://github.com/ungap/url-search-params\\n\\n` +\n `If you're unsure how to load polyfills, we recommend you check out ` +\n `https://polyfill.io/v3/ which provides some recommendations about how ` +\n `to load polyfills only for users that need them, instead of for every ` +\n `user.`\n );\n\n let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));\n\n let location = useLocation();\n let searchParams = React.useMemo(() => {\n let searchParams = createSearchParams(location.search);\n\n for (let key of defaultSearchParamsRef.current.keys()) {\n if (!searchParams.has(key)) {\n defaultSearchParamsRef.current.getAll(key).forEach((value) => {\n searchParams.append(key, value);\n });\n }\n }\n\n return searchParams;\n }, [location.search]);\n\n let navigate = useNavigate();\n let setSearchParams = React.useCallback(\n (\n nextInit: URLSearchParamsInit,\n navigateOptions?: { replace?: boolean; state?: any }\n ) => {\n navigate(\"?\" + createSearchParams(nextInit), navigateOptions);\n },\n [navigate]\n );\n\n return [searchParams, setSearchParams] as const;\n}\n\nexport type ParamKeyValuePair = [string, string];\n\nexport type URLSearchParamsInit =\n | string\n | ParamKeyValuePair[]\n | Record\n | URLSearchParams;\n\n/**\n * Creates a URLSearchParams object using the given initializer.\n *\n * This is identical to `new URLSearchParams(init)` except it also\n * supports arrays as values in the object form of the initializer\n * instead of just strings. This is convenient when you need multiple\n * values for a given key, but don't want to use an array initializer.\n *\n * For example, instead of:\n *\n * let searchParams = new URLSearchParams([\n * ['sort', 'name'],\n * ['sort', 'price']\n * ]);\n *\n * you can do:\n *\n * let searchParams = createSearchParams({\n * sort: ['name', 'price']\n * });\n */\nexport function createSearchParams(\n init: URLSearchParamsInit = \"\"\n): URLSearchParams {\n return new URLSearchParams(\n typeof init === \"string\" ||\n Array.isArray(init) ||\n init instanceof URLSearchParams\n ? init\n : Object.keys(init).reduce((memo, key) => {\n let value = init[key];\n return memo.concat(\n Array.isArray(value) ? value.map((v) => [key, v]) : [[key, value]]\n );\n }, [] as ParamKeyValuePair[])\n );\n}\n","import defineProperty from \"./defineProperty.js\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nexport default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n\n return target;\n}","export enum SearchTypes {\n Gene = 'gene',\n Drug = 'drug',\n Categories = 'categories',\n}\n\nexport enum ResultTypes {\n Gene = 'gene',\n Drug = 'drug',\n}\n","import { SearchTypes } from 'types/types';\n\ntype ActionMap = {\n [Key in keyof M]: M[Key] extends undefined\n ? {\n type: Key;\n }\n : {\n type: Key;\n payload: M[Key];\n };\n};\n\nexport enum ActionTypes {\n AddTerm = 'ADD_TERM',\n DeleteTerm = 'DELETE_TERM',\n DeleteLastTerm = 'DELETE_LAST_TERM',\n DeleteAllTerms = 'DELETE_ALL_TERMS',\n AddGeneDemoTerms = 'GENE_DEMO_TERMS',\n AddCategoryDemoTerms = 'CATEGORY_DEMO_TERMS',\n AddDrugDemoTerms = 'DRUG_DEMO_TERMS',\n HideDisclaimer = 'HIDE_DISCLAIMER',\n ShowDisclaimer = 'SHOW_DISCLAIMER',\n EnableDarkMode = 'ENABLE_DARK_MODE',\n DisableDarkMode = 'DISABLE_DARK_MODE',\n SetByDrug = 'SET_INTERACTIONS_BY_DRUG',\n SetByGene = 'SET_INTERACTIONS_BY_GENE',\n SetGeneCategories = 'SET_GENE_CATEGORIES',\n BrandPage = 'BRAND_PAGE',\n ContentPage = 'CONTENT_PAGE',\n}\n\n// search terms\ntype SearchTermsPayload = {\n [ActionTypes.AddTerm]: string;\n [ActionTypes.AddGeneDemoTerms]: undefined;\n [ActionTypes.AddCategoryDemoTerms]: undefined;\n [ActionTypes.AddDrugDemoTerms]: undefined;\n [ActionTypes.DeleteTerm]: string;\n [ActionTypes.DeleteLastTerm]: undefined;\n [ActionTypes.DeleteAllTerms]: undefined;\n};\n\nexport type SearchTermsActions =\n ActionMap[keyof ActionMap];\n\nexport const searchTermsReducer = (\n state: string[],\n action: InteractionModeActions | SearchTermsActions | ThemeSettingsActions\n) => {\n let stateCopy = Array.from(state);\n switch (action.type) {\n case ActionTypes.AddTerm:\n return [...stateCopy, action.payload];\n case ActionTypes.AddGeneDemoTerms:\n return [\n 'FLT1',\n 'FLT2',\n 'FLT3',\n 'STK1',\n 'MM1',\n 'AQP1',\n 'LOC100508755',\n 'FAKE1',\n ];\n case ActionTypes.AddDrugDemoTerms:\n return ['SUNITINIB', 'ZALCITABINE', 'TRASTUZUMAB', 'NOTREAL'];\n case ActionTypes.AddCategoryDemoTerms:\n return ['HER2', 'ERBB2', 'PTGDR', 'EGFR', 'RECK', 'KCNMA1', 'MM1'];\n case ActionTypes.DeleteLastTerm:\n return stateCopy.slice(0, -1);\n case ActionTypes.DeleteAllTerms:\n return [];\n case ActionTypes.DeleteTerm:\n return stateCopy.filter((term: any) => term !== action.payload);\n default:\n return state;\n }\n};\n\n// interaction mode\ntype InteractionModePayload = {\n [ActionTypes.SetByDrug]: undefined;\n [ActionTypes.SetByGene]: undefined;\n [ActionTypes.SetGeneCategories]: undefined;\n};\n\nexport type InteractionModeActions =\n ActionMap[keyof ActionMap];\n\nexport const interactionModeReducer = (\n state: SearchTypes,\n action: InteractionModeActions | SearchTermsActions | ThemeSettingsActions\n) => {\n switch (action.type) {\n case ActionTypes.SetByDrug:\n return SearchTypes.Drug;\n case ActionTypes.SetByGene:\n return SearchTypes.Gene;\n case ActionTypes.SetGeneCategories:\n return SearchTypes.Categories;\n default:\n return state;\n }\n};\n\n// theme settings\nexport interface themeSettingsType {\n showDisclaimer: boolean;\n darkModeEnabled: boolean;\n brandTheme: boolean;\n}\n\ntype ThemeSettingsPayload = {\n [ActionTypes.HideDisclaimer]: undefined;\n [ActionTypes.ShowDisclaimer]: undefined;\n [ActionTypes.EnableDarkMode]: undefined;\n [ActionTypes.DisableDarkMode]: undefined;\n [ActionTypes.BrandPage]: undefined;\n [ActionTypes.ContentPage]: undefined;\n};\n\nexport type ThemeSettingsActions =\n ActionMap[keyof ActionMap];\n\nexport const themeSettingsReducer = (\n state: themeSettingsType,\n action: InteractionModeActions | SearchTermsActions | ThemeSettingsActions\n) => {\n let stateCopy = Object.assign({}, state);\n switch (action.type) {\n case ActionTypes.HideDisclaimer:\n return { ...stateCopy, showDisclaimer: false };\n case ActionTypes.ShowDisclaimer:\n return { ...stateCopy, showDisclaimer: true };\n case ActionTypes.EnableDarkMode:\n return { ...stateCopy, darkModeEnabled: true };\n case ActionTypes.DisableDarkMode:\n return { ...stateCopy, darkModeEnabled: false };\n case ActionTypes.BrandPage:\n return { ...stateCopy, brandTheme: true };\n case ActionTypes.ContentPage:\n return { ...stateCopy, brandTheme: false };\n default:\n return state;\n }\n};\n","import React, { createContext, useReducer, Dispatch } from 'react';\nimport {\n searchTermsReducer,\n SearchTermsActions,\n themeSettingsType,\n themeSettingsReducer,\n ThemeSettingsActions,\n interactionModeReducer,\n InteractionModeActions,\n} from './reducers';\nimport { SearchTypes } from 'types/types';\n\ntype InitialStateType = {\n interactionMode: SearchTypes;\n searchTerms: string[];\n themeSettings: themeSettingsType;\n};\n\nconst initialState: InitialStateType = {\n interactionMode: SearchTypes.Gene,\n searchTerms: [],\n themeSettings: {\n showDisclaimer: false,\n darkModeEnabled: false,\n brandTheme: false,\n },\n};\n\nconst GlobalClientContext = createContext<{\n state: InitialStateType;\n dispatch: Dispatch<\n InteractionModeActions | SearchTermsActions | ThemeSettingsActions\n >;\n}>({\n state: initialState,\n dispatch: () => null,\n});\n\nconst mainReducer = (\n { searchTerms, themeSettings, interactionMode }: InitialStateType,\n action: InteractionModeActions | SearchTermsActions | ThemeSettingsActions\n) => ({\n searchTerms: searchTermsReducer(searchTerms, action),\n themeSettings: themeSettingsReducer(themeSettings, action),\n interactionMode: interactionModeReducer(interactionMode, action),\n});\n\nconst GlobalClient: React.FC = ({ children }) => {\n const [state, dispatch] = useReducer(mainReducer, initialState);\n\n return (\n \n {children}\n \n );\n};\n\nexport { GlobalClient, GlobalClientContext };\n","import React from 'react';\nimport { QueryClient, QueryClientProvider } from 'react-query';\nimport { BrowserRouter as Router } from 'react-router-dom';\nimport { GlobalClient } from 'stores/Global/GlobalClient';\n\nexport const queryClient = new QueryClient();\nexport const GlobalContext = React.createContext(null);\n\ntype AppProviderProps = {\n children: React.ReactNode;\n};\n\nexport const AppProvider = ({ children }: AppProviderProps) => {\n return (\n
    \n \n \n {children}\n \n \n
    \n );\n};\n","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\n/* eslint-disable no-constant-condition */\nimport * as React from 'react';\nimport { unstable_setRef as setRef, unstable_useEventCallback as useEventCallback, unstable_useControlled as useControlled, unstable_useId as useId } from '@mui/utils';\n\n// https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript\n// Give up on IE11 support for this feature\nfunction stripDiacritics(string) {\n return typeof string.normalize !== 'undefined' ? string.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '') : string;\n}\nexport function createFilterOptions(config = {}) {\n const {\n ignoreAccents = true,\n ignoreCase = true,\n limit,\n matchFrom = 'any',\n stringify,\n trim = false\n } = config;\n return (options, {\n inputValue,\n getOptionLabel\n }) => {\n let input = trim ? inputValue.trim() : inputValue;\n if (ignoreCase) {\n input = input.toLowerCase();\n }\n if (ignoreAccents) {\n input = stripDiacritics(input);\n }\n const filteredOptions = !input ? options : options.filter(option => {\n let candidate = (stringify || getOptionLabel)(option);\n if (ignoreCase) {\n candidate = candidate.toLowerCase();\n }\n if (ignoreAccents) {\n candidate = stripDiacritics(candidate);\n }\n return matchFrom === 'start' ? candidate.indexOf(input) === 0 : candidate.indexOf(input) > -1;\n });\n return typeof limit === 'number' ? filteredOptions.slice(0, limit) : filteredOptions;\n };\n}\n\n// To replace with .findIndex() once we stop IE11 support.\nfunction findIndex(array, comp) {\n for (let i = 0; i < array.length; i += 1) {\n if (comp(array[i])) {\n return i;\n }\n }\n return -1;\n}\nconst defaultFilterOptions = createFilterOptions();\n\n// Number of options to jump in list box when pageup and pagedown keys are used.\nconst pageSize = 5;\nconst defaultIsActiveElementInListbox = listboxRef => {\n var _listboxRef$current$p;\n return listboxRef.current !== null && ((_listboxRef$current$p = listboxRef.current.parentElement) == null ? void 0 : _listboxRef$current$p.contains(document.activeElement));\n};\nexport default function useAutocomplete(props) {\n const {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_isActiveElementInListbox = defaultIsActiveElementInListbox,\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_classNamePrefix = 'Mui',\n autoComplete = false,\n autoHighlight = false,\n autoSelect = false,\n blurOnSelect = false,\n clearOnBlur = !props.freeSolo,\n clearOnEscape = false,\n componentName = 'useAutocomplete',\n defaultValue = props.multiple ? [] : null,\n disableClearable = false,\n disableCloseOnSelect = false,\n disabled: disabledProp,\n disabledItemsFocusable = false,\n disableListWrap = false,\n filterOptions = defaultFilterOptions,\n filterSelectedOptions = false,\n freeSolo = false,\n getOptionDisabled,\n getOptionLabel: getOptionLabelProp = option => {\n var _option$label;\n return (_option$label = option.label) != null ? _option$label : option;\n },\n groupBy,\n handleHomeEndKeys = !props.freeSolo,\n id: idProp,\n includeInputInList = false,\n inputValue: inputValueProp,\n isOptionEqualToValue = (option, value) => option === value,\n multiple = false,\n onChange,\n onClose,\n onHighlightChange,\n onInputChange,\n onOpen,\n open: openProp,\n openOnFocus = false,\n options,\n readOnly = false,\n selectOnFocus = !props.freeSolo,\n value: valueProp\n } = props;\n const id = useId(idProp);\n let getOptionLabel = getOptionLabelProp;\n getOptionLabel = option => {\n const optionLabel = getOptionLabelProp(option);\n if (typeof optionLabel !== 'string') {\n if (process.env.NODE_ENV !== 'production') {\n const erroneousReturn = optionLabel === undefined ? 'undefined' : `${typeof optionLabel} (${optionLabel})`;\n console.error(`MUI: The \\`getOptionLabel\\` method of ${componentName} returned ${erroneousReturn} instead of a string for ${JSON.stringify(option)}.`);\n }\n return String(optionLabel);\n }\n return optionLabel;\n };\n const ignoreFocus = React.useRef(false);\n const firstFocus = React.useRef(true);\n const inputRef = React.useRef(null);\n const listboxRef = React.useRef(null);\n const [anchorEl, setAnchorEl] = React.useState(null);\n const [focusedTag, setFocusedTag] = React.useState(-1);\n const defaultHighlighted = autoHighlight ? 0 : -1;\n const highlightedIndexRef = React.useRef(defaultHighlighted);\n const [value, setValueState] = useControlled({\n controlled: valueProp,\n default: defaultValue,\n name: componentName\n });\n const [inputValue, setInputValueState] = useControlled({\n controlled: inputValueProp,\n default: '',\n name: componentName,\n state: 'inputValue'\n });\n const [focused, setFocused] = React.useState(false);\n const resetInputValue = React.useCallback((event, newValue) => {\n // retain current `inputValue` if new option isn't selected and `clearOnBlur` is false\n // When `multiple` is enabled, `newValue` is an array of all selected items including the newly selected item\n const isOptionSelected = multiple ? value.length < newValue.length : newValue !== null;\n if (!isOptionSelected && !clearOnBlur) {\n return;\n }\n let newInputValue;\n if (multiple) {\n newInputValue = '';\n } else if (newValue == null) {\n newInputValue = '';\n } else {\n const optionLabel = getOptionLabel(newValue);\n newInputValue = typeof optionLabel === 'string' ? optionLabel : '';\n }\n if (inputValue === newInputValue) {\n return;\n }\n setInputValueState(newInputValue);\n if (onInputChange) {\n onInputChange(event, newInputValue, 'reset');\n }\n }, [getOptionLabel, inputValue, multiple, onInputChange, setInputValueState, clearOnBlur, value]);\n const prevValue = React.useRef();\n React.useEffect(() => {\n const valueChange = value !== prevValue.current;\n prevValue.current = value;\n if (focused && !valueChange) {\n return;\n }\n\n // Only reset the input's value when freeSolo if the component's value changes.\n if (freeSolo && !valueChange) {\n return;\n }\n resetInputValue(null, value);\n }, [value, resetInputValue, focused, prevValue, freeSolo]);\n const [open, setOpenState] = useControlled({\n controlled: openProp,\n default: false,\n name: componentName,\n state: 'open'\n });\n const [inputPristine, setInputPristine] = React.useState(true);\n const inputValueIsSelectedValue = !multiple && value != null && inputValue === getOptionLabel(value);\n const popupOpen = open && !readOnly;\n const filteredOptions = popupOpen ? filterOptions(options.filter(option => {\n if (filterSelectedOptions && (multiple ? value : [value]).some(value2 => value2 !== null && isOptionEqualToValue(option, value2))) {\n return false;\n }\n return true;\n }),\n // we use the empty string to manipulate `filterOptions` to not filter any options\n // i.e. the filter predicate always returns true\n {\n inputValue: inputValueIsSelectedValue && inputPristine ? '' : inputValue,\n getOptionLabel\n }) : [];\n const listboxAvailable = open && filteredOptions.length > 0 && !readOnly;\n if (process.env.NODE_ENV !== 'production') {\n if (value !== null && !freeSolo && options.length > 0) {\n const missingValue = (multiple ? value : [value]).filter(value2 => !options.some(option => isOptionEqualToValue(option, value2)));\n if (missingValue.length > 0) {\n console.warn([`MUI: The value provided to ${componentName} is invalid.`, `None of the options match with \\`${missingValue.length > 1 ? JSON.stringify(missingValue) : JSON.stringify(missingValue[0])}\\`.`, 'You can use the `isOptionEqualToValue` prop to customize the equality test.'].join('\\n'));\n }\n }\n }\n const focusTag = useEventCallback(tagToFocus => {\n if (tagToFocus === -1) {\n inputRef.current.focus();\n } else {\n anchorEl.querySelector(`[data-tag-index=\"${tagToFocus}\"]`).focus();\n }\n });\n\n // Ensure the focusedTag is never inconsistent\n React.useEffect(() => {\n if (multiple && focusedTag > value.length - 1) {\n setFocusedTag(-1);\n focusTag(-1);\n }\n }, [value, multiple, focusedTag, focusTag]);\n function validOptionIndex(index, direction) {\n if (!listboxRef.current || index === -1) {\n return -1;\n }\n let nextFocus = index;\n while (true) {\n // Out of range\n if (direction === 'next' && nextFocus === filteredOptions.length || direction === 'previous' && nextFocus === -1) {\n return -1;\n }\n const option = listboxRef.current.querySelector(`[data-option-index=\"${nextFocus}\"]`);\n\n // Same logic as MenuList.js\n const nextFocusDisabled = disabledItemsFocusable ? false : !option || option.disabled || option.getAttribute('aria-disabled') === 'true';\n if (option && !option.hasAttribute('tabindex') || nextFocusDisabled) {\n // Move to the next element.\n nextFocus += direction === 'next' ? 1 : -1;\n } else {\n return nextFocus;\n }\n }\n }\n const setHighlightedIndex = useEventCallback(({\n event,\n index,\n reason = 'auto'\n }) => {\n highlightedIndexRef.current = index;\n\n // does the index exist?\n if (index === -1) {\n inputRef.current.removeAttribute('aria-activedescendant');\n } else {\n inputRef.current.setAttribute('aria-activedescendant', `${id}-option-${index}`);\n }\n if (onHighlightChange) {\n onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);\n }\n if (!listboxRef.current) {\n return;\n }\n const prev = listboxRef.current.querySelector(`[role=\"option\"].${unstable_classNamePrefix}-focused`);\n if (prev) {\n prev.classList.remove(`${unstable_classNamePrefix}-focused`);\n prev.classList.remove(`${unstable_classNamePrefix}-focusVisible`);\n }\n const listboxNode = listboxRef.current.parentElement.querySelector('[role=\"listbox\"]');\n\n // \"No results\"\n if (!listboxNode) {\n return;\n }\n if (index === -1) {\n listboxNode.scrollTop = 0;\n return;\n }\n const option = listboxRef.current.querySelector(`[data-option-index=\"${index}\"]`);\n if (!option) {\n return;\n }\n option.classList.add(`${unstable_classNamePrefix}-focused`);\n if (reason === 'keyboard') {\n option.classList.add(`${unstable_classNamePrefix}-focusVisible`);\n }\n\n // Scroll active descendant into view.\n // Logic copied from https://www.w3.org/WAI/ARIA/apg/example-index/combobox/js/select-only.js\n //\n // Consider this API instead once it has a better browser support:\n // .scrollIntoView({ scrollMode: 'if-needed', block: 'nearest' });\n if (listboxNode.scrollHeight > listboxNode.clientHeight && reason !== 'mouse') {\n const element = option;\n const scrollBottom = listboxNode.clientHeight + listboxNode.scrollTop;\n const elementBottom = element.offsetTop + element.offsetHeight;\n if (elementBottom > scrollBottom) {\n listboxNode.scrollTop = elementBottom - listboxNode.clientHeight;\n } else if (element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0) < listboxNode.scrollTop) {\n listboxNode.scrollTop = element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0);\n }\n }\n });\n const changeHighlightedIndex = useEventCallback(({\n event,\n diff,\n direction = 'next',\n reason = 'auto'\n }) => {\n if (!popupOpen) {\n return;\n }\n const getNextIndex = () => {\n const maxIndex = filteredOptions.length - 1;\n if (diff === 'reset') {\n return defaultHighlighted;\n }\n if (diff === 'start') {\n return 0;\n }\n if (diff === 'end') {\n return maxIndex;\n }\n const newIndex = highlightedIndexRef.current + diff;\n if (newIndex < 0) {\n if (newIndex === -1 && includeInputInList) {\n return -1;\n }\n if (disableListWrap && highlightedIndexRef.current !== -1 || Math.abs(diff) > 1) {\n return 0;\n }\n return maxIndex;\n }\n if (newIndex > maxIndex) {\n if (newIndex === maxIndex + 1 && includeInputInList) {\n return -1;\n }\n if (disableListWrap || Math.abs(diff) > 1) {\n return maxIndex;\n }\n return 0;\n }\n return newIndex;\n };\n const nextIndex = validOptionIndex(getNextIndex(), direction);\n setHighlightedIndex({\n index: nextIndex,\n reason,\n event\n });\n\n // Sync the content of the input with the highlighted option.\n if (autoComplete && diff !== 'reset') {\n if (nextIndex === -1) {\n inputRef.current.value = inputValue;\n } else {\n const option = getOptionLabel(filteredOptions[nextIndex]);\n inputRef.current.value = option;\n\n // The portion of the selected suggestion that has not been typed by the user,\n // a completion string, appears inline after the input cursor in the textbox.\n const index = option.toLowerCase().indexOf(inputValue.toLowerCase());\n if (index === 0 && inputValue.length > 0) {\n inputRef.current.setSelectionRange(inputValue.length, option.length);\n }\n }\n }\n });\n const syncHighlightedIndex = React.useCallback(() => {\n if (!popupOpen) {\n return;\n }\n const valueItem = multiple ? value[0] : value;\n\n // The popup is empty, reset\n if (filteredOptions.length === 0 || valueItem == null) {\n changeHighlightedIndex({\n diff: 'reset'\n });\n return;\n }\n if (!listboxRef.current) {\n return;\n }\n\n // Synchronize the value with the highlighted index\n if (valueItem != null) {\n const currentOption = filteredOptions[highlightedIndexRef.current];\n\n // Keep the current highlighted index if possible\n if (multiple && currentOption && findIndex(value, val => isOptionEqualToValue(currentOption, val)) !== -1) {\n return;\n }\n const itemIndex = findIndex(filteredOptions, optionItem => isOptionEqualToValue(optionItem, valueItem));\n if (itemIndex === -1) {\n changeHighlightedIndex({\n diff: 'reset'\n });\n } else {\n setHighlightedIndex({\n index: itemIndex\n });\n }\n return;\n }\n\n // Prevent the highlighted index to leak outside the boundaries.\n if (highlightedIndexRef.current >= filteredOptions.length - 1) {\n setHighlightedIndex({\n index: filteredOptions.length - 1\n });\n return;\n }\n\n // Restore the focus to the previous index.\n setHighlightedIndex({\n index: highlightedIndexRef.current\n });\n // Ignore filteredOptions (and options, isOptionEqualToValue, getOptionLabel) not to break the scroll position\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n // Only sync the highlighted index when the option switch between empty and not\n filteredOptions.length,\n // Don't sync the highlighted index with the value when multiple\n // eslint-disable-next-line react-hooks/exhaustive-deps\n multiple ? false : value, filterSelectedOptions, changeHighlightedIndex, setHighlightedIndex, popupOpen, inputValue, multiple]);\n const handleListboxRef = useEventCallback(node => {\n setRef(listboxRef, node);\n if (!node) {\n return;\n }\n syncHighlightedIndex();\n });\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (!inputRef.current || inputRef.current.nodeName !== 'INPUT') {\n if (inputRef.current && inputRef.current.nodeName === 'TEXTAREA') {\n console.warn([`A textarea element was provided to ${componentName} where input was expected.`, `This is not a supported scenario but it may work under certain conditions.`, `A textarea keyboard navigation may conflict with Autocomplete controls (e.g. enter and arrow keys).`, `Make sure to test keyboard navigation and add custom event handlers if necessary.`].join('\\n'));\n } else {\n console.error([`MUI: Unable to find the input element. It was resolved to ${inputRef.current} while an HTMLInputElement was expected.`, `Instead, ${componentName} expects an input element.`, '', componentName === 'useAutocomplete' ? 'Make sure you have binded getInputProps correctly and that the normal ref/effect resolutions order is guaranteed.' : 'Make sure you have customized the input component correctly.'].join('\\n'));\n }\n }\n }, [componentName]);\n }\n React.useEffect(() => {\n syncHighlightedIndex();\n }, [syncHighlightedIndex]);\n const handleOpen = event => {\n if (open) {\n return;\n }\n setOpenState(true);\n setInputPristine(true);\n if (onOpen) {\n onOpen(event);\n }\n };\n const handleClose = (event, reason) => {\n if (!open) {\n return;\n }\n setOpenState(false);\n if (onClose) {\n onClose(event, reason);\n }\n };\n const handleValue = (event, newValue, reason, details) => {\n if (multiple) {\n if (value.length === newValue.length && value.every((val, i) => val === newValue[i])) {\n return;\n }\n } else if (value === newValue) {\n return;\n }\n if (onChange) {\n onChange(event, newValue, reason, details);\n }\n setValueState(newValue);\n };\n const isTouch = React.useRef(false);\n const selectNewValue = (event, option, reasonProp = 'selectOption', origin = 'options') => {\n let reason = reasonProp;\n let newValue = option;\n if (multiple) {\n newValue = Array.isArray(value) ? value.slice() : [];\n if (process.env.NODE_ENV !== 'production') {\n const matches = newValue.filter(val => isOptionEqualToValue(option, val));\n if (matches.length > 1) {\n console.error([`MUI: The \\`isOptionEqualToValue\\` method of ${componentName} do not handle the arguments correctly.`, `The component expects a single value to match a given option but found ${matches.length} matches.`].join('\\n'));\n }\n }\n const itemIndex = findIndex(newValue, valueItem => isOptionEqualToValue(option, valueItem));\n if (itemIndex === -1) {\n newValue.push(option);\n } else if (origin !== 'freeSolo') {\n newValue.splice(itemIndex, 1);\n reason = 'removeOption';\n }\n }\n resetInputValue(event, newValue);\n handleValue(event, newValue, reason, {\n option\n });\n if (!disableCloseOnSelect && (!event || !event.ctrlKey && !event.metaKey)) {\n handleClose(event, reason);\n }\n if (blurOnSelect === true || blurOnSelect === 'touch' && isTouch.current || blurOnSelect === 'mouse' && !isTouch.current) {\n inputRef.current.blur();\n }\n };\n function validTagIndex(index, direction) {\n if (index === -1) {\n return -1;\n }\n let nextFocus = index;\n while (true) {\n // Out of range\n if (direction === 'next' && nextFocus === value.length || direction === 'previous' && nextFocus === -1) {\n return -1;\n }\n const option = anchorEl.querySelector(`[data-tag-index=\"${nextFocus}\"]`);\n\n // Same logic as MenuList.js\n if (!option || !option.hasAttribute('tabindex') || option.disabled || option.getAttribute('aria-disabled') === 'true') {\n nextFocus += direction === 'next' ? 1 : -1;\n } else {\n return nextFocus;\n }\n }\n }\n const handleFocusTag = (event, direction) => {\n if (!multiple) {\n return;\n }\n if (inputValue === '') {\n handleClose(event, 'toggleInput');\n }\n let nextTag = focusedTag;\n if (focusedTag === -1) {\n if (inputValue === '' && direction === 'previous') {\n nextTag = value.length - 1;\n }\n } else {\n nextTag += direction === 'next' ? 1 : -1;\n if (nextTag < 0) {\n nextTag = 0;\n }\n if (nextTag === value.length) {\n nextTag = -1;\n }\n }\n nextTag = validTagIndex(nextTag, direction);\n setFocusedTag(nextTag);\n focusTag(nextTag);\n };\n const handleClear = event => {\n ignoreFocus.current = true;\n setInputValueState('');\n if (onInputChange) {\n onInputChange(event, '', 'clear');\n }\n handleValue(event, multiple ? [] : null, 'clear');\n };\n const handleKeyDown = other => event => {\n if (other.onKeyDown) {\n other.onKeyDown(event);\n }\n if (event.defaultMuiPrevented) {\n return;\n }\n if (focusedTag !== -1 && ['ArrowLeft', 'ArrowRight'].indexOf(event.key) === -1) {\n setFocusedTag(-1);\n focusTag(-1);\n }\n\n // Wait until IME is settled.\n if (event.which !== 229) {\n switch (event.key) {\n case 'Home':\n if (popupOpen && handleHomeEndKeys) {\n // Prevent scroll of the page\n event.preventDefault();\n changeHighlightedIndex({\n diff: 'start',\n direction: 'next',\n reason: 'keyboard',\n event\n });\n }\n break;\n case 'End':\n if (popupOpen && handleHomeEndKeys) {\n // Prevent scroll of the page\n event.preventDefault();\n changeHighlightedIndex({\n diff: 'end',\n direction: 'previous',\n reason: 'keyboard',\n event\n });\n }\n break;\n case 'PageUp':\n // Prevent scroll of the page\n event.preventDefault();\n changeHighlightedIndex({\n diff: -pageSize,\n direction: 'previous',\n reason: 'keyboard',\n event\n });\n handleOpen(event);\n break;\n case 'PageDown':\n // Prevent scroll of the page\n event.preventDefault();\n changeHighlightedIndex({\n diff: pageSize,\n direction: 'next',\n reason: 'keyboard',\n event\n });\n handleOpen(event);\n break;\n case 'ArrowDown':\n // Prevent cursor move\n event.preventDefault();\n changeHighlightedIndex({\n diff: 1,\n direction: 'next',\n reason: 'keyboard',\n event\n });\n handleOpen(event);\n break;\n case 'ArrowUp':\n // Prevent cursor move\n event.preventDefault();\n changeHighlightedIndex({\n diff: -1,\n direction: 'previous',\n reason: 'keyboard',\n event\n });\n handleOpen(event);\n break;\n case 'ArrowLeft':\n handleFocusTag(event, 'previous');\n break;\n case 'ArrowRight':\n handleFocusTag(event, 'next');\n break;\n case 'Enter':\n if (highlightedIndexRef.current !== -1 && popupOpen) {\n const option = filteredOptions[highlightedIndexRef.current];\n const disabled = getOptionDisabled ? getOptionDisabled(option) : false;\n\n // Avoid early form validation, let the end-users continue filling the form.\n event.preventDefault();\n if (disabled) {\n return;\n }\n selectNewValue(event, option, 'selectOption');\n\n // Move the selection to the end.\n if (autoComplete) {\n inputRef.current.setSelectionRange(inputRef.current.value.length, inputRef.current.value.length);\n }\n } else if (freeSolo && inputValue !== '' && inputValueIsSelectedValue === false) {\n if (multiple) {\n // Allow people to add new values before they submit the form.\n event.preventDefault();\n }\n selectNewValue(event, inputValue, 'createOption', 'freeSolo');\n }\n break;\n case 'Escape':\n if (popupOpen) {\n // Avoid Opera to exit fullscreen mode.\n event.preventDefault();\n // Avoid the Modal to handle the event.\n event.stopPropagation();\n handleClose(event, 'escape');\n } else if (clearOnEscape && (inputValue !== '' || multiple && value.length > 0)) {\n // Avoid Opera to exit fullscreen mode.\n event.preventDefault();\n // Avoid the Modal to handle the event.\n event.stopPropagation();\n handleClear(event);\n }\n break;\n case 'Backspace':\n if (multiple && !readOnly && inputValue === '' && value.length > 0) {\n const index = focusedTag === -1 ? value.length - 1 : focusedTag;\n const newValue = value.slice();\n newValue.splice(index, 1);\n handleValue(event, newValue, 'removeOption', {\n option: value[index]\n });\n }\n break;\n case 'Delete':\n if (multiple && !readOnly && inputValue === '' && value.length > 0 && focusedTag !== -1) {\n const index = focusedTag;\n const newValue = value.slice();\n newValue.splice(index, 1);\n handleValue(event, newValue, 'removeOption', {\n option: value[index]\n });\n }\n break;\n default:\n }\n }\n };\n const handleFocus = event => {\n setFocused(true);\n if (openOnFocus && !ignoreFocus.current) {\n handleOpen(event);\n }\n };\n const handleBlur = event => {\n // Ignore the event when using the scrollbar with IE11\n if (unstable_isActiveElementInListbox(listboxRef)) {\n inputRef.current.focus();\n return;\n }\n setFocused(false);\n firstFocus.current = true;\n ignoreFocus.current = false;\n if (autoSelect && highlightedIndexRef.current !== -1 && popupOpen) {\n selectNewValue(event, filteredOptions[highlightedIndexRef.current], 'blur');\n } else if (autoSelect && freeSolo && inputValue !== '') {\n selectNewValue(event, inputValue, 'blur', 'freeSolo');\n } else if (clearOnBlur) {\n resetInputValue(event, value);\n }\n handleClose(event, 'blur');\n };\n const handleInputChange = event => {\n const newValue = event.target.value;\n if (inputValue !== newValue) {\n setInputValueState(newValue);\n setInputPristine(false);\n if (onInputChange) {\n onInputChange(event, newValue, 'input');\n }\n }\n if (newValue === '') {\n if (!disableClearable && !multiple) {\n handleValue(event, null, 'clear');\n }\n } else {\n handleOpen(event);\n }\n };\n const handleOptionMouseOver = event => {\n setHighlightedIndex({\n event,\n index: Number(event.currentTarget.getAttribute('data-option-index')),\n reason: 'mouse'\n });\n };\n const handleOptionTouchStart = () => {\n isTouch.current = true;\n };\n const handleOptionClick = event => {\n const index = Number(event.currentTarget.getAttribute('data-option-index'));\n selectNewValue(event, filteredOptions[index], 'selectOption');\n isTouch.current = false;\n };\n const handleTagDelete = index => event => {\n const newValue = value.slice();\n newValue.splice(index, 1);\n handleValue(event, newValue, 'removeOption', {\n option: value[index]\n });\n };\n const handlePopupIndicator = event => {\n if (open) {\n handleClose(event, 'toggleInput');\n } else {\n handleOpen(event);\n }\n };\n\n // Prevent input blur when interacting with the combobox\n const handleMouseDown = event => {\n if (event.target.getAttribute('id') !== id) {\n event.preventDefault();\n }\n };\n\n // Focus the input when interacting with the combobox\n const handleClick = () => {\n inputRef.current.focus();\n if (selectOnFocus && firstFocus.current && inputRef.current.selectionEnd - inputRef.current.selectionStart === 0) {\n inputRef.current.select();\n }\n firstFocus.current = false;\n };\n const handleInputMouseDown = event => {\n if (inputValue === '' || !open) {\n handlePopupIndicator(event);\n }\n };\n let dirty = freeSolo && inputValue.length > 0;\n dirty = dirty || (multiple ? value.length > 0 : value !== null);\n let groupedOptions = filteredOptions;\n if (groupBy) {\n // used to keep track of key and indexes in the result array\n const indexBy = new Map();\n let warn = false;\n groupedOptions = filteredOptions.reduce((acc, option, index) => {\n const group = groupBy(option);\n if (acc.length > 0 && acc[acc.length - 1].group === group) {\n acc[acc.length - 1].options.push(option);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n if (indexBy.get(group) && !warn) {\n console.warn(`MUI: The options provided combined with the \\`groupBy\\` method of ${componentName} returns duplicated headers.`, 'You can solve the issue by sorting the options with the output of `groupBy`.');\n warn = true;\n }\n indexBy.set(group, true);\n }\n acc.push({\n key: index,\n index,\n group,\n options: [option]\n });\n }\n return acc;\n }, []);\n }\n if (disabledProp && focused) {\n handleBlur();\n }\n return {\n getRootProps: (other = {}) => _extends({\n 'aria-owns': listboxAvailable ? `${id}-listbox` : null\n }, other, {\n onKeyDown: handleKeyDown(other),\n onMouseDown: handleMouseDown,\n onClick: handleClick\n }),\n getInputLabelProps: () => ({\n id: `${id}-label`,\n htmlFor: id\n }),\n getInputProps: () => ({\n id,\n value: inputValue,\n onBlur: handleBlur,\n onFocus: handleFocus,\n onChange: handleInputChange,\n onMouseDown: handleInputMouseDown,\n // if open then this is handled imperativeley so don't let react override\n // only have an opinion about this when closed\n 'aria-activedescendant': popupOpen ? '' : null,\n 'aria-autocomplete': autoComplete ? 'both' : 'list',\n 'aria-controls': listboxAvailable ? `${id}-listbox` : undefined,\n 'aria-expanded': listboxAvailable,\n // Disable browser's suggestion that might overlap with the popup.\n // Handle autocomplete but not autofill.\n autoComplete: 'off',\n ref: inputRef,\n autoCapitalize: 'none',\n spellCheck: 'false',\n role: 'combobox'\n }),\n getClearProps: () => ({\n tabIndex: -1,\n onClick: handleClear\n }),\n getPopupIndicatorProps: () => ({\n tabIndex: -1,\n onClick: handlePopupIndicator\n }),\n getTagProps: ({\n index\n }) => _extends({\n key: index,\n 'data-tag-index': index,\n tabIndex: -1\n }, !readOnly && {\n onDelete: handleTagDelete(index)\n }),\n getListboxProps: () => ({\n role: 'listbox',\n id: `${id}-listbox`,\n 'aria-labelledby': `${id}-label`,\n ref: handleListboxRef,\n onMouseDown: event => {\n // Prevent blur\n event.preventDefault();\n }\n }),\n getOptionProps: ({\n index,\n option\n }) => {\n const selected = (multiple ? value : [value]).some(value2 => value2 != null && isOptionEqualToValue(option, value2));\n const disabled = getOptionDisabled ? getOptionDisabled(option) : false;\n return {\n key: getOptionLabel(option),\n tabIndex: -1,\n role: 'option',\n id: `${id}-option-${index}`,\n onMouseOver: handleOptionMouseOver,\n onClick: handleOptionClick,\n onTouchStart: handleOptionTouchStart,\n 'data-option-index': index,\n 'aria-disabled': disabled,\n 'aria-selected': selected\n };\n },\n id,\n inputValue,\n value,\n dirty,\n popupOpen,\n focused: focused || focusedTag !== -1,\n anchorEl,\n setAnchorEl,\n focusedTag,\n groupedOptions\n };\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}","import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","export default function getUAString() {\n var uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands) {\n return uaData.brands.map(function (item) {\n return item.brand + \"/\" + item.version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}","import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}","import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n\n var clientRect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport getComputedStyle from \"./dom-utils/getComputedStyle.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport validateModifiers from \"./utils/validateModifiers.js\";\nimport uniqueBy from \"./utils/uniqueBy.js\";\nimport getBasePlacement from \"./utils/getBasePlacement.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nimport { auto } from \"./enums.js\";\nvar INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nvar INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n }); // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n\n if (process.env.NODE_ENV !== \"production\") {\n var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {\n var name = _ref.name;\n return name;\n });\n validateModifiers(modifiers);\n\n if (getBasePlacement(state.options.placement) === auto) {\n var flipModifier = state.orderedModifiers.find(function (_ref2) {\n var name = _ref2.name;\n return name === 'flip';\n });\n\n if (!flipModifier) {\n console.error(['Popper: \"auto\" placements require the \"flip\" modifier be', 'present and enabled to work.'].join(' '));\n }\n }\n\n var _getComputedStyle = getComputedStyle(popper),\n marginTop = _getComputedStyle.marginTop,\n marginRight = _getComputedStyle.marginRight,\n marginBottom = _getComputedStyle.marginBottom,\n marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n\n\n if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {\n return parseFloat(margin);\n })) {\n console.warn(['Popper: CSS \"margin\" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));\n }\n }\n\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n var __debug_loops__ = 0;\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (process.env.NODE_ENV !== \"production\") {\n __debug_loops__ += 1;\n\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref) {\n var x = _ref.x,\n y = _ref.y;\n var win = window;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n\n if (process.env.NODE_ENV !== \"production\") {\n var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {\n return transitionProperty.indexOf(property) >= 0;\n })) {\n console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".', '\\n\\n', 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\\n\\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));\n }\n }\n\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!isHTMLElement(arrowElement)) {\n console.error(['Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: \"arrow\" modifier\\'s `element` must be a child of the popper', 'element.'].join(' '));\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, \"auto\" cannot be used to allow \"bottom-start\".', 'Use \"auto-start\" instead.'].join(' '));\n }\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport { exactProp, HTMLElementType, unstable_useEnhancedEffect as useEnhancedEffect, unstable_useForkRef as useForkRef, unstable_setRef as setRef } from '@mui/utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction getContainer(container) {\n return typeof container === 'function' ? container() : container;\n}\n\n/**\n * Portals provide a first-class way to render children into a DOM node\n * that exists outside the DOM hierarchy of the parent component.\n */\nconst Portal = /*#__PURE__*/React.forwardRef(function Portal(props, ref) {\n const {\n children,\n container,\n disablePortal = false\n } = props;\n const [mountNode, setMountNode] = React.useState(null);\n const handleRef = useForkRef( /*#__PURE__*/React.isValidElement(children) ? children.ref : null, ref);\n useEnhancedEffect(() => {\n if (!disablePortal) {\n setMountNode(getContainer(container) || document.body);\n }\n }, [container, disablePortal]);\n useEnhancedEffect(() => {\n if (mountNode && !disablePortal) {\n setRef(ref, mountNode);\n return () => {\n setRef(ref, null);\n };\n }\n return undefined;\n }, [ref, mountNode, disablePortal]);\n if (disablePortal) {\n if ( /*#__PURE__*/React.isValidElement(children)) {\n return /*#__PURE__*/React.cloneElement(children, {\n ref: handleRef\n });\n }\n return children;\n }\n return /*#__PURE__*/_jsx(React.Fragment, {\n children: mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? Portal.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The children to render into the `container`.\n */\n children: PropTypes.node,\n /**\n * An HTML element or function that returns one.\n * The `container` will have the portal children appended to it.\n *\n * By default, it uses the body of the top-level document object,\n * so it's simply `document.body` most of the time.\n */\n container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),\n /**\n * The `children` will be under the DOM hierarchy of the parent component.\n * @default false\n */\n disablePortal: PropTypes.bool\n} : void 0;\nif (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n Portal['propTypes' + ''] = exactProp(Portal.propTypes);\n}\nexport default Portal;","import generateUtilityClass from '../generateUtilityClass';\nimport generateUtilityClasses from '../generateUtilityClasses';\nexport function getPopperUnstyledUtilityClass(slot) {\n return generateUtilityClass('MuiPopperUnstyled', slot);\n}\nconst popperUnstyledClasses = generateUtilityClasses('MuiPopperUnstyled', ['root']);\nexport default popperUnstyledClasses;","/**\n * Determines if a given element is a DOM element name (i.e. not a React component).\n */\nfunction isHostComponent(element) {\n return typeof element === 'string';\n}\nexport default isHostComponent;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport isHostComponent from './isHostComponent';\n\n/**\n * Type of the ownerState based on the type of an element it applies to.\n * This resolves to the provided OwnerState for React components and `undefined` for host components.\n * Falls back to `OwnerState | undefined` when the exact type can't be determined in development time.\n */\n\n/**\n * Appends the ownerState object to the props, merging with the existing one if necessary.\n *\n * @param elementType Type of the element that owns the `existingProps`. If the element is a DOM node or undefined, `ownerState` is not applied.\n * @param otherProps Props of the element.\n * @param ownerState\n */\nexport default function appendOwnerState(elementType, otherProps, ownerState) {\n if (elementType === undefined || isHostComponent(elementType)) {\n return otherProps;\n }\n return _extends({}, otherProps, {\n ownerState: _extends({}, otherProps.ownerState, ownerState)\n });\n}","/**\n * Removes event handlers from the given object.\n * A field is considered an event handler if it is a function with a name beginning with `on`.\n *\n * @param object Object to remove event handlers from.\n * @returns Object with event handlers removed.\n */\nexport default function omitEventHandlers(object) {\n if (object === undefined) {\n return {};\n }\n const result = {};\n Object.keys(object).filter(prop => !(prop.match(/^on[A-Z]/) && typeof object[prop] === 'function')).forEach(prop => {\n result[prop] = object[prop];\n });\n return result;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport clsx from 'clsx';\nimport extractEventHandlers from './extractEventHandlers';\nimport omitEventHandlers from './omitEventHandlers';\n/**\n * Merges the slot component internal props (usually coming from a hook)\n * with the externally provided ones.\n *\n * The merge order is (the latter overrides the former):\n * 1. The internal props (specified as a getter function to work with get*Props hook result)\n * 2. Additional props (specified internally on an unstyled component)\n * 3. External props specified on the owner component. These should only be used on a root slot.\n * 4. External props specified in the `slotProps.*` prop.\n * 5. The `className` prop - combined from all the above.\n * @param parameters\n * @returns\n */\nexport default function mergeSlotProps(parameters) {\n const {\n getSlotProps,\n additionalProps,\n externalSlotProps,\n externalForwardedProps,\n className\n } = parameters;\n if (!getSlotProps) {\n // The simpler case - getSlotProps is not defined, so no internal event handlers are defined,\n // so we can simply merge all the props without having to worry about extracting event handlers.\n const joinedClasses = clsx(externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className, className, additionalProps == null ? void 0 : additionalProps.className);\n const mergedStyle = _extends({}, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);\n const props = _extends({}, additionalProps, externalForwardedProps, externalSlotProps);\n if (joinedClasses.length > 0) {\n props.className = joinedClasses;\n }\n if (Object.keys(mergedStyle).length > 0) {\n props.style = mergedStyle;\n }\n return {\n props,\n internalRef: undefined\n };\n }\n\n // In this case, getSlotProps is responsible for calling the external event handlers.\n // We don't need to include them in the merged props because of this.\n\n const eventHandlers = extractEventHandlers(_extends({}, externalForwardedProps, externalSlotProps));\n const componentsPropsWithoutEventHandlers = omitEventHandlers(externalSlotProps);\n const otherPropsWithoutEventHandlers = omitEventHandlers(externalForwardedProps);\n const internalSlotProps = getSlotProps(eventHandlers);\n\n // The order of classes is important here.\n // Emotion (that we use in libraries consuming MUI Base) depends on this order\n // to properly override style. It requires the most important classes to be last\n // (see https://github.com/mui/material-ui/pull/33205) for the related discussion.\n const joinedClasses = clsx(internalSlotProps == null ? void 0 : internalSlotProps.className, additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);\n const mergedStyle = _extends({}, internalSlotProps == null ? void 0 : internalSlotProps.style, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);\n const props = _extends({}, internalSlotProps, additionalProps, otherPropsWithoutEventHandlers, componentsPropsWithoutEventHandlers);\n if (joinedClasses.length > 0) {\n props.className = joinedClasses;\n }\n if (Object.keys(mergedStyle).length > 0) {\n props.style = mergedStyle;\n }\n return {\n props,\n internalRef: internalSlotProps.ref\n };\n}","/**\n * Extracts event handlers from a given object.\n * A prop is considered an event handler if it is a function and its name starts with `on`.\n *\n * @param object An object to extract event handlers from.\n * @param excludeKeys An array of keys to exclude from the returned object.\n */\nexport default function extractEventHandlers(object, excludeKeys = []) {\n if (object === undefined) {\n return {};\n }\n const result = {};\n Object.keys(object).filter(prop => prop.match(/^on[A-Z]/) && typeof object[prop] === 'function' && !excludeKeys.includes(prop)).forEach(prop => {\n result[prop] = object[prop];\n });\n return result;\n}","/**\n * If `componentProps` is a function, calls it with the provided `ownerState`.\n * Otherwise, just returns `componentProps`.\n */\nexport default function resolveComponentProps(componentProps, ownerState) {\n if (typeof componentProps === 'function') {\n return componentProps(ownerState);\n }\n return componentProps;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"elementType\", \"externalSlotProps\", \"ownerState\"];\nimport { unstable_useForkRef as useForkRef } from '@mui/utils';\nimport appendOwnerState from './appendOwnerState';\nimport mergeSlotProps from './mergeSlotProps';\nimport resolveComponentProps from './resolveComponentProps';\n/**\n * Builds the props to be passed into the slot of an unstyled component.\n * It merges the internal props of the component with the ones supplied by the user, allowing to customize the behavior.\n * If the slot component is not a host component, it also merges in the `ownerState`.\n *\n * @param parameters.getSlotProps - A function that returns the props to be passed to the slot component.\n */\nexport default function useSlotProps(parameters) {\n var _parameters$additiona;\n const {\n elementType,\n externalSlotProps,\n ownerState\n } = parameters,\n rest = _objectWithoutPropertiesLoose(parameters, _excluded);\n const resolvedComponentsProps = resolveComponentProps(externalSlotProps, ownerState);\n const {\n props: mergedProps,\n internalRef\n } = mergeSlotProps(_extends({}, rest, {\n externalSlotProps: resolvedComponentsProps\n }));\n const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, (_parameters$additiona = parameters.additionalProps) == null ? void 0 : _parameters$additiona.ref);\n const props = appendOwnerState(elementType, _extends({}, mergedProps, {\n ref\n }), ownerState);\n return props;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"anchorEl\", \"children\", \"component\", \"direction\", \"disablePortal\", \"modifiers\", \"open\", \"ownerState\", \"placement\", \"popperOptions\", \"popperRef\", \"slotProps\", \"slots\", \"TransitionProps\"],\n _excluded2 = [\"anchorEl\", \"children\", \"container\", \"direction\", \"disablePortal\", \"keepMounted\", \"modifiers\", \"open\", \"placement\", \"popperOptions\", \"popperRef\", \"style\", \"transition\", \"slotProps\", \"slots\"];\nimport * as React from 'react';\nimport { chainPropTypes, HTMLElementType, refType, unstable_ownerDocument as ownerDocument, unstable_useEnhancedEffect as useEnhancedEffect, unstable_useForkRef as useForkRef } from '@mui/utils';\nimport { createPopper } from '@popperjs/core';\nimport PropTypes from 'prop-types';\nimport composeClasses from '../composeClasses';\nimport Portal from '../Portal';\nimport { getPopperUnstyledUtilityClass } from './popperUnstyledClasses';\nimport { useSlotProps } from '../utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction flipPlacement(placement, direction) {\n if (direction === 'ltr') {\n return placement;\n }\n switch (placement) {\n case 'bottom-end':\n return 'bottom-start';\n case 'bottom-start':\n return 'bottom-end';\n case 'top-end':\n return 'top-start';\n case 'top-start':\n return 'top-end';\n default:\n return placement;\n }\n}\nfunction resolveAnchorEl(anchorEl) {\n return typeof anchorEl === 'function' ? anchorEl() : anchorEl;\n}\nfunction isHTMLElement(element) {\n return element.nodeType !== undefined;\n}\nfunction isVirtualElement(element) {\n return !isHTMLElement(element);\n}\nconst useUtilityClasses = () => {\n const slots = {\n root: ['root']\n };\n return composeClasses(slots, getPopperUnstyledUtilityClass, {});\n};\nconst defaultPopperOptions = {};\nconst PopperTooltip = /*#__PURE__*/React.forwardRef(function PopperTooltip(props, ref) {\n var _ref;\n const {\n anchorEl,\n children,\n component,\n direction,\n disablePortal,\n modifiers,\n open,\n ownerState,\n placement: initialPlacement,\n popperOptions,\n popperRef: popperRefProp,\n slotProps = {},\n slots = {},\n TransitionProps\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const tooltipRef = React.useRef(null);\n const ownRef = useForkRef(tooltipRef, ref);\n const popperRef = React.useRef(null);\n const handlePopperRef = useForkRef(popperRef, popperRefProp);\n const handlePopperRefRef = React.useRef(handlePopperRef);\n useEnhancedEffect(() => {\n handlePopperRefRef.current = handlePopperRef;\n }, [handlePopperRef]);\n React.useImperativeHandle(popperRefProp, () => popperRef.current, []);\n const rtlPlacement = flipPlacement(initialPlacement, direction);\n /**\n * placement initialized from prop but can change during lifetime if modifiers.flip.\n * modifiers.flip is essentially a flip for controlled/uncontrolled behavior\n */\n const [placement, setPlacement] = React.useState(rtlPlacement);\n const [resolvedAnchorElement, setResolvedAnchorElement] = React.useState(resolveAnchorEl(anchorEl));\n React.useEffect(() => {\n if (popperRef.current) {\n popperRef.current.forceUpdate();\n }\n });\n React.useEffect(() => {\n if (anchorEl) {\n setResolvedAnchorElement(resolveAnchorEl(anchorEl));\n }\n }, [anchorEl]);\n useEnhancedEffect(() => {\n if (!resolvedAnchorElement || !open) {\n return undefined;\n }\n const handlePopperUpdate = data => {\n setPlacement(data.placement);\n };\n if (process.env.NODE_ENV !== 'production') {\n if (resolvedAnchorElement && isHTMLElement(resolvedAnchorElement) && resolvedAnchorElement.nodeType === 1) {\n const box = resolvedAnchorElement.getBoundingClientRect();\n if (process.env.NODE_ENV !== 'test' && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {\n console.warn(['MUI: The `anchorEl` prop provided to the component is invalid.', 'The anchor element should be part of the document layout.', \"Make sure the element is present in the document or that it's not display none.\"].join('\\n'));\n }\n }\n }\n let popperModifiers = [{\n name: 'preventOverflow',\n options: {\n altBoundary: disablePortal\n }\n }, {\n name: 'flip',\n options: {\n altBoundary: disablePortal\n }\n }, {\n name: 'onUpdate',\n enabled: true,\n phase: 'afterWrite',\n fn: ({\n state\n }) => {\n handlePopperUpdate(state);\n }\n }];\n if (modifiers != null) {\n popperModifiers = popperModifiers.concat(modifiers);\n }\n if (popperOptions && popperOptions.modifiers != null) {\n popperModifiers = popperModifiers.concat(popperOptions.modifiers);\n }\n const popper = createPopper(resolvedAnchorElement, tooltipRef.current, _extends({\n placement: rtlPlacement\n }, popperOptions, {\n modifiers: popperModifiers\n }));\n handlePopperRefRef.current(popper);\n return () => {\n popper.destroy();\n handlePopperRefRef.current(null);\n };\n }, [resolvedAnchorElement, disablePortal, modifiers, open, popperOptions, rtlPlacement]);\n const childProps = {\n placement: placement\n };\n if (TransitionProps !== null) {\n childProps.TransitionProps = TransitionProps;\n }\n const classes = useUtilityClasses();\n const Root = (_ref = component != null ? component : slots.root) != null ? _ref : 'div';\n const rootProps = useSlotProps({\n elementType: Root,\n externalSlotProps: slotProps.root,\n externalForwardedProps: other,\n additionalProps: {\n role: 'tooltip',\n ref: ownRef\n },\n ownerState: _extends({}, props, ownerState),\n className: classes.root\n });\n return /*#__PURE__*/_jsx(Root, _extends({}, rootProps, {\n children: typeof children === 'function' ? children(childProps) : children\n }));\n});\n\n/**\n * Poppers rely on the 3rd party library [Popper.js](https://popper.js.org/docs/v2/) for positioning.\n *\n * Demos:\n *\n * - [Unstyled Popper](https://mui.com/base/react-popper/)\n *\n * API:\n *\n * - [PopperUnstyled API](https://mui.com/base/api/popper-unstyled/)\n */\nconst PopperUnstyled = /*#__PURE__*/React.forwardRef(function PopperUnstyled(props, ref) {\n const {\n anchorEl,\n children,\n container: containerProp,\n direction = 'ltr',\n disablePortal = false,\n keepMounted = false,\n modifiers,\n open,\n placement = 'bottom',\n popperOptions = defaultPopperOptions,\n popperRef,\n style,\n transition = false,\n slotProps = {},\n slots = {}\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded2);\n const [exited, setExited] = React.useState(true);\n const handleEnter = () => {\n setExited(false);\n };\n const handleExited = () => {\n setExited(true);\n };\n if (!keepMounted && !open && (!transition || exited)) {\n return null;\n }\n\n // If the container prop is provided, use that\n // If the anchorEl prop is provided, use its parent body element as the container\n // If neither are provided let the Modal take care of choosing the container\n let container;\n if (containerProp) {\n container = containerProp;\n } else if (anchorEl) {\n const resolvedAnchorEl = resolveAnchorEl(anchorEl);\n container = resolvedAnchorEl && isHTMLElement(resolvedAnchorEl) ? ownerDocument(resolvedAnchorEl).body : ownerDocument(null).body;\n }\n const display = !open && keepMounted && (!transition || exited) ? 'none' : undefined;\n const transitionProps = transition ? {\n in: open,\n onEnter: handleEnter,\n onExited: handleExited\n } : undefined;\n return /*#__PURE__*/_jsx(Portal, {\n disablePortal: disablePortal,\n container: container,\n children: /*#__PURE__*/_jsx(PopperTooltip, _extends({\n anchorEl: anchorEl,\n direction: direction,\n disablePortal: disablePortal,\n modifiers: modifiers,\n ref: ref,\n open: transition ? !exited : open,\n placement: placement,\n popperOptions: popperOptions,\n popperRef: popperRef,\n slotProps: slotProps,\n slots: slots\n }, other, {\n style: _extends({\n // Prevents scroll issue, waiting for Popper.js to add this style once initiated.\n position: 'fixed',\n // Fix Popper.js display issue\n top: 0,\n left: 0,\n display\n }, style),\n TransitionProps: transitionProps,\n children: children\n }))\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? PopperUnstyled.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),\n * or a function that returns either.\n * It's used to set the position of the popper.\n * The return value will passed as the reference object of the Popper instance.\n */\n anchorEl: chainPropTypes(PropTypes.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]), props => {\n if (props.open) {\n const resolvedAnchorEl = resolveAnchorEl(props.anchorEl);\n if (resolvedAnchorEl && isHTMLElement(resolvedAnchorEl) && resolvedAnchorEl.nodeType === 1) {\n const box = resolvedAnchorEl.getBoundingClientRect();\n if (process.env.NODE_ENV !== 'test' && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {\n return new Error(['MUI: The `anchorEl` prop provided to the component is invalid.', 'The anchor element should be part of the document layout.', \"Make sure the element is present in the document or that it's not display none.\"].join('\\n'));\n }\n } else if (!resolvedAnchorEl || typeof resolvedAnchorEl.getBoundingClientRect !== 'function' || isVirtualElement(resolvedAnchorEl) && resolvedAnchorEl.contextElement != null && resolvedAnchorEl.contextElement.nodeType !== 1) {\n return new Error(['MUI: The `anchorEl` prop provided to the component is invalid.', 'It should be an HTML element instance or a virtualElement ', '(https://popper.js.org/docs/v2/virtual-elements/).'].join('\\n'));\n }\n }\n return null;\n }),\n /**\n * Popper render function or node.\n */\n children: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.node, PropTypes.func]),\n /**\n * An HTML element or function that returns one.\n * The `container` will have the portal children appended to it.\n *\n * By default, it uses the body of the top-level document object,\n * so it's simply `document.body` most of the time.\n */\n container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),\n /**\n * Direction of the text.\n * @default 'ltr'\n */\n direction: PropTypes.oneOf(['ltr', 'rtl']),\n /**\n * The `children` will be under the DOM hierarchy of the parent component.\n * @default false\n */\n disablePortal: PropTypes.bool,\n /**\n * Always keep the children in the DOM.\n * This prop can be useful in SEO situation or\n * when you want to maximize the responsiveness of the Popper.\n * @default false\n */\n keepMounted: PropTypes.bool,\n /**\n * Popper.js is based on a \"plugin-like\" architecture,\n * most of its features are fully encapsulated \"modifiers\".\n *\n * A modifier is a function that is called each time Popper.js needs to\n * compute the position of the popper.\n * For this reason, modifiers should be very performant to avoid bottlenecks.\n * To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).\n */\n modifiers: PropTypes.arrayOf(PropTypes.shape({\n data: PropTypes.object,\n effect: PropTypes.func,\n enabled: PropTypes.bool,\n fn: PropTypes.func,\n name: PropTypes.any,\n options: PropTypes.object,\n phase: PropTypes.oneOf(['afterMain', 'afterRead', 'afterWrite', 'beforeMain', 'beforeRead', 'beforeWrite', 'main', 'read', 'write']),\n requires: PropTypes.arrayOf(PropTypes.string),\n requiresIfExists: PropTypes.arrayOf(PropTypes.string)\n })),\n /**\n * If `true`, the component is shown.\n */\n open: PropTypes.bool.isRequired,\n /**\n * Popper placement.\n * @default 'bottom'\n */\n placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),\n /**\n * Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.\n * @default {}\n */\n popperOptions: PropTypes.shape({\n modifiers: PropTypes.array,\n onFirstUpdate: PropTypes.func,\n placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),\n strategy: PropTypes.oneOf(['absolute', 'fixed'])\n }),\n /**\n * A ref that points to the used popper instance.\n */\n popperRef: refType,\n /**\n * The props used for each slot inside the Popper.\n * @default {}\n */\n slotProps: PropTypes.shape({\n root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])\n }),\n /**\n * The components used for each slot inside the Popper.\n * Either a string to use a HTML element or a component.\n * @default {}\n */\n slots: PropTypes.shape({\n root: PropTypes.elementType\n }),\n /**\n * @ignore\n */\n style: PropTypes.object,\n /**\n * Help supporting a react-transition-group/Transition component.\n * @default false\n */\n transition: PropTypes.bool\n} : void 0;\nexport default PopperUnstyled;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"components\", \"componentsProps\", \"slots\", \"slotProps\"];\nimport PopperUnstyled from '@mui/base/PopperUnstyled';\nimport { useThemeWithoutDefault as useTheme } from '@mui/system';\nimport { HTMLElementType, refType } from '@mui/utils';\nimport PropTypes from 'prop-types';\nimport * as React from 'react';\nimport { styled, useThemeProps } from '../styles';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst PopperRoot = styled(PopperUnstyled, {\n name: 'MuiPopper',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})({});\n\n/**\n *\n * Demos:\n *\n * - [Autocomplete](https://mui.com/material-ui/react-autocomplete/)\n * - [Menu](https://mui.com/material-ui/react-menu/)\n * - [Popper](https://mui.com/material-ui/react-popper/)\n *\n * API:\n *\n * - [Popper API](https://mui.com/material-ui/api/popper/)\n */\nconst Popper = /*#__PURE__*/React.forwardRef(function Popper(inProps, ref) {\n var _slots$root;\n const theme = useTheme();\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPopper'\n });\n const {\n components,\n componentsProps,\n slots,\n slotProps\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const RootComponent = (_slots$root = slots == null ? void 0 : slots.root) != null ? _slots$root : components == null ? void 0 : components.Root;\n return /*#__PURE__*/_jsx(PopperRoot, _extends({\n direction: theme == null ? void 0 : theme.direction,\n slots: {\n root: RootComponent\n },\n slotProps: slotProps != null ? slotProps : componentsProps\n }, other, {\n ref: ref\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? Popper.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),\n * or a function that returns either.\n * It's used to set the position of the popper.\n * The return value will passed as the reference object of the Popper instance.\n */\n anchorEl: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]),\n /**\n * Popper render function or node.\n */\n children: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.node, PropTypes.func]),\n /**\n * @ignore\n */\n component: PropTypes /* @typescript-to-proptypes-ignore */.elementType,\n /**\n * The components used for each slot inside the Popper.\n * Either a string to use a HTML element or a component.\n * @default {}\n */\n components: PropTypes.shape({\n Root: PropTypes.elementType\n }),\n /**\n * The props used for each slot inside the Popper.\n * @default {}\n */\n componentsProps: PropTypes.shape({\n root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])\n }),\n /**\n * An HTML element or function that returns one.\n * The `container` will have the portal children appended to it.\n *\n * By default, it uses the body of the top-level document object,\n * so it's simply `document.body` most of the time.\n */\n container: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.func]),\n /**\n * The `children` will be under the DOM hierarchy of the parent component.\n * @default false\n */\n disablePortal: PropTypes.bool,\n /**\n * Always keep the children in the DOM.\n * This prop can be useful in SEO situation or\n * when you want to maximize the responsiveness of the Popper.\n * @default false\n */\n keepMounted: PropTypes.bool,\n /**\n * Popper.js is based on a \"plugin-like\" architecture,\n * most of its features are fully encapsulated \"modifiers\".\n *\n * A modifier is a function that is called each time Popper.js needs to\n * compute the position of the popper.\n * For this reason, modifiers should be very performant to avoid bottlenecks.\n * To learn how to create a modifier, [read the modifiers documentation](https://popper.js.org/docs/v2/modifiers/).\n */\n modifiers: PropTypes.arrayOf(PropTypes.shape({\n data: PropTypes.object,\n effect: PropTypes.func,\n enabled: PropTypes.bool,\n fn: PropTypes.func,\n name: PropTypes.any,\n options: PropTypes.object,\n phase: PropTypes.oneOf(['afterMain', 'afterRead', 'afterWrite', 'beforeMain', 'beforeRead', 'beforeWrite', 'main', 'read', 'write']),\n requires: PropTypes.arrayOf(PropTypes.string),\n requiresIfExists: PropTypes.arrayOf(PropTypes.string)\n })),\n /**\n * If `true`, the component is shown.\n */\n open: PropTypes.bool.isRequired,\n /**\n * @ignore\n */\n ownerState: PropTypes.any,\n /**\n * Popper placement.\n * @default 'bottom'\n */\n placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),\n /**\n * Options provided to the [`Popper.js`](https://popper.js.org/docs/v2/constructors/#options) instance.\n * @default {}\n */\n popperOptions: PropTypes.shape({\n modifiers: PropTypes.array,\n onFirstUpdate: PropTypes.func,\n placement: PropTypes.oneOf(['auto-end', 'auto-start', 'auto', 'bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),\n strategy: PropTypes.oneOf(['absolute', 'fixed'])\n }),\n /**\n * A ref that points to the used popper instance.\n */\n popperRef: refType,\n /**\n * The props used for each slot inside the Popper.\n * @default {}\n */\n slotProps: PropTypes.shape({\n root: PropTypes.oneOfType([PropTypes.func, PropTypes.object])\n }),\n /**\n * The components used for each slot inside the Popper.\n * Either a string to use a HTML element or a component.\n * @default {}\n */\n slots: PropTypes.shape({\n root: PropTypes.elementType\n }),\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * Help supporting a react-transition-group/Transition component.\n * @default false\n */\n transition: PropTypes.bool\n} : void 0;\nexport default Popper;","import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nimport generateUtilityClass from '../generateUtilityClass';\nexport function getListSubheaderUtilityClass(slot) {\n return generateUtilityClass('MuiListSubheader', slot);\n}\nconst listSubheaderClasses = generateUtilityClasses('MuiListSubheader', ['root', 'colorPrimary', 'colorInherit', 'gutters', 'inset', 'sticky']);\nexport default listSubheaderClasses;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\", \"color\", \"component\", \"disableGutters\", \"disableSticky\", \"inset\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport capitalize from '../utils/capitalize';\nimport { getListSubheaderUtilityClass } from './listSubheaderClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n color,\n disableGutters,\n inset,\n disableSticky\n } = ownerState;\n const slots = {\n root: ['root', color !== 'default' && `color${capitalize(color)}`, !disableGutters && 'gutters', inset && 'inset', !disableSticky && 'sticky']\n };\n return composeClasses(slots, getListSubheaderUtilityClass, classes);\n};\nconst ListSubheaderRoot = styled('li', {\n name: 'MuiListSubheader',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.color !== 'default' && styles[`color${capitalize(ownerState.color)}`], !ownerState.disableGutters && styles.gutters, ownerState.inset && styles.inset, !ownerState.disableSticky && styles.sticky];\n }\n})(({\n theme,\n ownerState\n}) => _extends({\n boxSizing: 'border-box',\n lineHeight: '48px',\n listStyle: 'none',\n color: (theme.vars || theme).palette.text.secondary,\n fontFamily: theme.typography.fontFamily,\n fontWeight: theme.typography.fontWeightMedium,\n fontSize: theme.typography.pxToRem(14)\n}, ownerState.color === 'primary' && {\n color: (theme.vars || theme).palette.primary.main\n}, ownerState.color === 'inherit' && {\n color: 'inherit'\n}, !ownerState.disableGutters && {\n paddingLeft: 16,\n paddingRight: 16\n}, ownerState.inset && {\n paddingLeft: 72\n}, !ownerState.disableSticky && {\n position: 'sticky',\n top: 0,\n zIndex: 1,\n backgroundColor: (theme.vars || theme).palette.background.paper\n}));\nconst ListSubheader = /*#__PURE__*/React.forwardRef(function ListSubheader(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiListSubheader'\n });\n const {\n className,\n color = 'default',\n component = 'li',\n disableGutters = false,\n disableSticky = false,\n inset = false\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n color,\n component,\n disableGutters,\n disableSticky,\n inset\n });\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(ListSubheaderRoot, _extends({\n as: component,\n className: clsx(classes.root, className),\n ref: ref,\n ownerState: ownerState\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? ListSubheader.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * @default 'default'\n */\n color: PropTypes.oneOf(['default', 'inherit', 'primary']),\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * If `true`, the List Subheader will not have gutters.\n * @default false\n */\n disableGutters: PropTypes.bool,\n /**\n * If `true`, the List Subheader will not stick to the top during scroll.\n * @default false\n */\n disableSticky: PropTypes.bool,\n /**\n * If `true`, the List Subheader is indented.\n * @default false\n */\n inset: PropTypes.bool,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default ListSubheader;","// Inspired by https://github.com/material-components/material-components-ios/blob/bca36107405594d5b7b16265a5b0ed698f85a5ee/components/Elevation/src/UIColor%2BMaterialElevation.m#L61\nconst getOverlayAlpha = elevation => {\n let alphaValue;\n if (elevation < 1) {\n alphaValue = 5.11916 * elevation ** 2;\n } else {\n alphaValue = 4.5 * Math.log(elevation + 1) + 2;\n }\n return (alphaValue / 100).toFixed(2);\n};\nexport default getOverlayAlpha;","import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nimport generateUtilityClass from '../generateUtilityClass';\nexport function getPaperUtilityClass(slot) {\n return generateUtilityClass('MuiPaper', slot);\n}\nconst paperClasses = generateUtilityClasses('MuiPaper', ['root', 'rounded', 'outlined', 'elevation', 'elevation0', 'elevation1', 'elevation2', 'elevation3', 'elevation4', 'elevation5', 'elevation6', 'elevation7', 'elevation8', 'elevation9', 'elevation10', 'elevation11', 'elevation12', 'elevation13', 'elevation14', 'elevation15', 'elevation16', 'elevation17', 'elevation18', 'elevation19', 'elevation20', 'elevation21', 'elevation22', 'elevation23', 'elevation24']);\nexport default paperClasses;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\", \"component\", \"elevation\", \"square\", \"variant\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { chainPropTypes, integerPropType } from '@mui/utils';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport { alpha } from '@mui/system';\nimport styled from '../styles/styled';\nimport getOverlayAlpha from '../styles/getOverlayAlpha';\nimport useThemeProps from '../styles/useThemeProps';\nimport useTheme from '../styles/useTheme';\nimport { getPaperUtilityClass } from './paperClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n square,\n elevation,\n variant,\n classes\n } = ownerState;\n const slots = {\n root: ['root', variant, !square && 'rounded', variant === 'elevation' && `elevation${elevation}`]\n };\n return composeClasses(slots, getPaperUtilityClass, classes);\n};\nconst PaperRoot = styled('div', {\n name: 'MuiPaper',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[ownerState.variant], !ownerState.square && styles.rounded, ownerState.variant === 'elevation' && styles[`elevation${ownerState.elevation}`]];\n }\n})(({\n theme,\n ownerState\n}) => {\n var _theme$vars$overlays;\n return _extends({\n backgroundColor: (theme.vars || theme).palette.background.paper,\n color: (theme.vars || theme).palette.text.primary,\n transition: theme.transitions.create('box-shadow')\n }, !ownerState.square && {\n borderRadius: theme.shape.borderRadius\n }, ownerState.variant === 'outlined' && {\n border: `1px solid ${(theme.vars || theme).palette.divider}`\n }, ownerState.variant === 'elevation' && _extends({\n boxShadow: (theme.vars || theme).shadows[ownerState.elevation]\n }, !theme.vars && theme.palette.mode === 'dark' && {\n backgroundImage: `linear-gradient(${alpha('#fff', getOverlayAlpha(ownerState.elevation))}, ${alpha('#fff', getOverlayAlpha(ownerState.elevation))})`\n }, theme.vars && {\n backgroundImage: (_theme$vars$overlays = theme.vars.overlays) == null ? void 0 : _theme$vars$overlays[ownerState.elevation]\n }));\n});\nconst Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiPaper'\n });\n const {\n className,\n component = 'div',\n elevation = 1,\n square = false,\n variant = 'elevation'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n component,\n elevation,\n square,\n variant\n });\n const classes = useUtilityClasses(ownerState);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const theme = useTheme();\n if (theme.shadows[elevation] === undefined) {\n console.error([`MUI: The elevation provided is not available in the theme.`, `Please make sure that \\`theme.shadows[${elevation}]\\` is defined.`].join('\\n'));\n }\n }\n return /*#__PURE__*/_jsx(PaperRoot, _extends({\n as: component,\n ownerState: ownerState,\n className: clsx(classes.root, className),\n ref: ref\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? Paper.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * Shadow depth, corresponds to `dp` in the spec.\n * It accepts values between 0 and 24 inclusive.\n * @default 1\n */\n elevation: chainPropTypes(integerPropType, props => {\n const {\n elevation,\n variant\n } = props;\n if (elevation > 0 && variant === 'outlined') {\n return new Error(`MUI: Combining \\`elevation={${elevation}}\\` with \\`variant=\"${variant}\"\\` has no effect. Either use \\`elevation={0}\\` or use a different \\`variant\\`.`);\n }\n return null;\n }),\n /**\n * If `true`, rounded corners are disabled.\n * @default false\n */\n square: PropTypes.bool,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The variant to use.\n * @default 'elevation'\n */\n variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['elevation', 'outlined']), PropTypes.string])\n} : void 0;\nexport default Paper;","export default function _taggedTemplateLiteral(strings, raw) {\n if (!raw) {\n raw = strings.slice(0);\n }\n\n return Object.freeze(Object.defineProperties(strings, {\n raw: {\n value: Object.freeze(raw)\n }\n }));\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"@babel/runtime/helpers/esm/setPrototypeOf\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","import React from 'react';\nexport default React.createContext(null);","import { Children, cloneElement, isValidElement } from 'react';\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n\nexport function getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && isValidElement(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) Children.map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\nexport function mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nexport function getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\nexport function getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!isValidElement(child)) return;\n var hasPrev = (key in prevChildMapping);\n var hasNext = (key in nextChildMapping);\n var prevChild = prevChildMapping[key];\n var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = cloneElement(child, {\n in: false\n });\n } else if (hasNext && hasPrev && isValidElement(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { getChildMapping, getInitialChildMapping, getNextChildMapping } from './utils/ChildMapping';\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n};\n/**\n * The `` component manages a set of transition components\n * (`` and ``) in a list. Like with the transition\n * components, `` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the ``.\n *\n * Note that `` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\nvar TransitionGroup = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n contextValue: {\n isMounting: true\n },\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true;\n this.setState({\n contextValue: {\n isMounting: false\n }\n });\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n } // node is `undefined` when user provided `nodeRef` prop\n ;\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = getChildMapping(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = _extends({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = _objectWithoutPropertiesLoose(_this$props, [\"component\", \"childFactory\"]);\n\n var contextValue = this.state.contextValue;\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, children);\n }\n\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(Component, props, children));\n };\n\n return TransitionGroup;\n}(React.Component);\n\nTransitionGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * `` renders a `
    ` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `
    ` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: PropTypes.any,\n\n /**\n * A set of `` components, that are toggled `in` and out as they\n * leave. the `` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `` as\n * with our `` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: PropTypes.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: PropTypes.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","import { createElement, useContext, useRef, Fragment } from 'react';\nimport '@emotion/cache';\nimport { h as hasOwnProperty, E as Emotion, c as createEmotionProps, w as withEmotionCache, T as ThemeContext } from './emotion-element-6a883da9.browser.esm.js';\nexport { C as CacheProvider, T as ThemeContext, a as ThemeProvider, _ as __unsafe_useEmotionCache, u as useTheme, w as withEmotionCache, b as withTheme } from './emotion-element-6a883da9.browser.esm.js';\nimport '@babel/runtime/helpers/extends';\nimport '@emotion/weak-memoize';\nimport 'hoist-non-react-statics';\nimport '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport { insertStyles, registerStyles, getRegisteredStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectWithLayoutFallback, useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\nvar pkg = {\n\tname: \"@emotion/react\",\n\tversion: \"11.10.5\",\n\tmain: \"dist/emotion-react.cjs.js\",\n\tmodule: \"dist/emotion-react.esm.js\",\n\tbrowser: {\n\t\t\"./dist/emotion-react.esm.js\": \"./dist/emotion-react.browser.esm.js\"\n\t},\n\texports: {\n\t\t\".\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./dist/emotion-react.worker.esm.js\",\n\t\t\t\tbrowser: \"./dist/emotion-react.browser.esm.js\",\n\t\t\t\t\"default\": \"./dist/emotion-react.esm.js\"\n\t\t\t},\n\t\t\t\"default\": \"./dist/emotion-react.cjs.js\"\n\t\t},\n\t\t\"./jsx-runtime\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js\",\n\t\t\t\tbrowser: \"./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js\",\n\t\t\t\t\"default\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js\"\n\t\t\t},\n\t\t\t\"default\": \"./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js\"\n\t\t},\n\t\t\"./_isolated-hnrs\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js\",\n\t\t\t\tbrowser: \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js\",\n\t\t\t\t\"default\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js\"\n\t\t\t},\n\t\t\t\"default\": \"./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js\"\n\t\t},\n\t\t\"./jsx-dev-runtime\": {\n\t\t\tmodule: {\n\t\t\t\tworker: \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js\",\n\t\t\t\tbrowser: \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js\",\n\t\t\t\t\"default\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js\"\n\t\t\t},\n\t\t\t\"default\": \"./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js\"\n\t\t},\n\t\t\"./package.json\": \"./package.json\",\n\t\t\"./types/css-prop\": \"./types/css-prop.d.ts\",\n\t\t\"./macro\": \"./macro.js\"\n\t},\n\ttypes: \"types/index.d.ts\",\n\tfiles: [\n\t\t\"src\",\n\t\t\"dist\",\n\t\t\"jsx-runtime\",\n\t\t\"jsx-dev-runtime\",\n\t\t\"_isolated-hnrs\",\n\t\t\"types/*.d.ts\",\n\t\t\"macro.js\",\n\t\t\"macro.d.ts\",\n\t\t\"macro.js.flow\"\n\t],\n\tsideEffects: false,\n\tauthor: \"Emotion Contributors\",\n\tlicense: \"MIT\",\n\tscripts: {\n\t\t\"test:typescript\": \"dtslint types\"\n\t},\n\tdependencies: {\n\t\t\"@babel/runtime\": \"^7.18.3\",\n\t\t\"@emotion/babel-plugin\": \"^11.10.5\",\n\t\t\"@emotion/cache\": \"^11.10.5\",\n\t\t\"@emotion/serialize\": \"^1.1.1\",\n\t\t\"@emotion/use-insertion-effect-with-fallbacks\": \"^1.0.0\",\n\t\t\"@emotion/utils\": \"^1.2.0\",\n\t\t\"@emotion/weak-memoize\": \"^0.3.0\",\n\t\t\"hoist-non-react-statics\": \"^3.3.1\"\n\t},\n\tpeerDependencies: {\n\t\t\"@babel/core\": \"^7.0.0\",\n\t\treact: \">=16.8.0\"\n\t},\n\tpeerDependenciesMeta: {\n\t\t\"@babel/core\": {\n\t\t\toptional: true\n\t\t},\n\t\t\"@types/react\": {\n\t\t\toptional: true\n\t\t}\n\t},\n\tdevDependencies: {\n\t\t\"@babel/core\": \"^7.18.5\",\n\t\t\"@definitelytyped/dtslint\": \"0.0.112\",\n\t\t\"@emotion/css\": \"11.10.5\",\n\t\t\"@emotion/css-prettifier\": \"1.1.1\",\n\t\t\"@emotion/server\": \"11.10.0\",\n\t\t\"@emotion/styled\": \"11.10.5\",\n\t\t\"html-tag-names\": \"^1.1.2\",\n\t\treact: \"16.14.0\",\n\t\t\"svg-tag-names\": \"^1.1.1\",\n\t\ttypescript: \"^4.5.5\"\n\t},\n\trepository: \"https://github.com/emotion-js/emotion/tree/main/packages/react\",\n\tpublishConfig: {\n\t\taccess: \"public\"\n\t},\n\t\"umd:main\": \"dist/emotion-react.umd.min.js\",\n\tpreconstruct: {\n\t\tentrypoints: [\n\t\t\t\"./index.js\",\n\t\t\t\"./jsx-runtime.js\",\n\t\t\t\"./jsx-dev-runtime.js\",\n\t\t\t\"./_isolated-hnrs.js\"\n\t\t],\n\t\tumdName: \"emotionReact\",\n\t\texports: {\n\t\t\tenvConditions: [\n\t\t\t\t\"browser\",\n\t\t\t\t\"worker\"\n\t\t\t],\n\t\t\textra: {\n\t\t\t\t\"./types/css-prop\": \"./types/css-prop.d.ts\",\n\t\t\t\t\"./macro\": \"./macro.js\"\n\t\t\t}\n\t\t}\n\t}\n};\n\nvar jsx = function jsx(type, props) {\n var args = arguments;\n\n if (props == null || !hasOwnProperty.call(props, 'css')) {\n // $FlowFixMe\n return createElement.apply(undefined, args);\n }\n\n var argsLength = args.length;\n var createElementArgArray = new Array(argsLength);\n createElementArgArray[0] = Emotion;\n createElementArgArray[1] = createEmotionProps(type, props);\n\n for (var i = 2; i < argsLength; i++) {\n createElementArgArray[i] = args[i];\n } // $FlowFixMe\n\n\n return createElement.apply(null, createElementArgArray);\n};\n\nvar warnedAboutCssPropForGlobal = false; // maintain place over rerenders.\n// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild\n// initial client-side render from SSR, use place of hydrating tag\n\nvar Global = /* #__PURE__ */withEmotionCache(function (props, cache) {\n if (process.env.NODE_ENV !== 'production' && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is\n // probably using the custom createElement which\n // means it will be turned into a className prop\n // $FlowFixMe I don't really want to add it to the type since it shouldn't be used\n props.className || props.css)) {\n console.error(\"It looks like you're using the css prop on Global, did you mean to use the styles prop instead?\");\n warnedAboutCssPropForGlobal = true;\n }\n\n var styles = props.styles;\n var serialized = serializeStyles([styles], undefined, useContext(ThemeContext));\n // but it is based on a constant that will never change at runtime\n // it's effectively like having two implementations and switching them out\n // so it's not actually breaking anything\n\n\n var sheetRef = useRef();\n useInsertionEffectWithLayoutFallback(function () {\n var key = cache.key + \"-global\"; // use case of https://github.com/emotion-js/emotion/issues/2675\n\n var sheet = new cache.sheet.constructor({\n key: key,\n nonce: cache.sheet.nonce,\n container: cache.sheet.container,\n speedy: cache.sheet.isSpeedy\n });\n var rehydrating = false; // $FlowFixMe\n\n var node = document.querySelector(\"style[data-emotion=\\\"\" + key + \" \" + serialized.name + \"\\\"]\");\n\n if (cache.sheet.tags.length) {\n sheet.before = cache.sheet.tags[0];\n }\n\n if (node !== null) {\n rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s\n\n node.setAttribute('data-emotion', key);\n sheet.hydrate([node]);\n }\n\n sheetRef.current = [sheet, rehydrating];\n return function () {\n sheet.flush();\n };\n }, [cache]);\n useInsertionEffectWithLayoutFallback(function () {\n var sheetRefCurrent = sheetRef.current;\n var sheet = sheetRefCurrent[0],\n rehydrating = sheetRefCurrent[1];\n\n if (rehydrating) {\n sheetRefCurrent[1] = false;\n return;\n }\n\n if (serialized.next !== undefined) {\n // insert keyframes\n insertStyles(cache, serialized.next, true);\n }\n\n if (sheet.tags.length) {\n // if this doesn't exist then it will be null so the style element will be appended\n var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;\n sheet.before = element;\n sheet.flush();\n }\n\n cache.insert(\"\", serialized, sheet, false);\n }, [cache, serialized.name]);\n return null;\n});\n\nif (process.env.NODE_ENV !== 'production') {\n Global.displayName = 'EmotionGlobal';\n}\n\nfunction css() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return serializeStyles(args);\n}\n\nvar keyframes = function keyframes() {\n var insertable = css.apply(void 0, arguments);\n var name = \"animation-\" + insertable.name; // $FlowFixMe\n\n return {\n name: name,\n styles: \"@keyframes \" + name + \"{\" + insertable.styles + \"}\",\n anim: 1,\n toString: function toString() {\n return \"_EMO_\" + this.name + \"_\" + this.styles + \"_EMO_\";\n }\n };\n};\n\nvar classnames = function classnames(args) {\n var len = args.length;\n var i = 0;\n var cls = '';\n\n for (; i < len; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n if (process.env.NODE_ENV !== 'production' && arg.styles !== undefined && arg.name !== undefined) {\n console.error('You have passed styles created with `css` from `@emotion/react` package to the `cx`.\\n' + '`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from component.');\n }\n\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nfunction merge(registered, css, className) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serializedArr = _ref.serializedArr;\n var rules = useInsertionEffectAlwaysWithSyncFallback(function () {\n\n for (var i = 0; i < serializedArr.length; i++) {\n var res = insertStyles(cache, serializedArr[i], false);\n }\n });\n\n return null;\n};\n\nvar ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {\n var hasRendered = false;\n var serializedArr = [];\n\n var css = function css() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('css can only be used during render');\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`\n\n registerStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var cx = function cx() {\n if (hasRendered && process.env.NODE_ENV !== 'production') {\n throw new Error('cx can only be used during render');\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n var content = {\n css: css,\n cx: cx,\n theme: useContext(ThemeContext)\n };\n var ele = props.children(content);\n hasRendered = true;\n return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, {\n cache: cache,\n serializedArr: serializedArr\n }), ele);\n});\n\nif (process.env.NODE_ENV !== 'production') {\n ClassNames.displayName = 'EmotionClassNames';\n}\n\nif (process.env.NODE_ENV !== 'production') {\n var isBrowser = \"object\" !== 'undefined'; // #1727, #2905 for some reason Jest and Vitest evaluate modules twice if some consuming module gets mocked\n\n var isTestEnv = typeof jest !== 'undefined' || typeof vi !== 'undefined';\n\n if (isBrowser && !isTestEnv) {\n // globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later\n var globalContext = // $FlowIgnore\n typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef\n : isBrowser ? window : global;\n var globalKey = \"__EMOTION_REACT_\" + pkg.version.split('.')[0] + \"__\";\n\n if (globalContext[globalKey]) {\n console.warn('You are loading @emotion/react when it is already loaded. Running ' + 'multiple instances may cause problems. This can happen if multiple ' + 'versions are used, or if multiple builds of the same version are ' + 'used.');\n }\n\n globalContext[globalKey] = true;\n }\n}\n\nexport { ClassNames, Global, jsx as createElement, css, jsx, keyframes };\n","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\n\n/**\n * @ignore - internal component.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction Ripple(props) {\n const {\n className,\n classes,\n pulsate = false,\n rippleX,\n rippleY,\n rippleSize,\n in: inProp,\n onExited,\n timeout\n } = props;\n const [leaving, setLeaving] = React.useState(false);\n const rippleClassName = clsx(className, classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);\n const rippleStyles = {\n width: rippleSize,\n height: rippleSize,\n top: -(rippleSize / 2) + rippleY,\n left: -(rippleSize / 2) + rippleX\n };\n const childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);\n if (!inProp && !leaving) {\n setLeaving(true);\n }\n React.useEffect(() => {\n if (!inProp && onExited != null) {\n // react-transition-group#onExited\n const timeoutId = setTimeout(onExited, timeout);\n return () => {\n clearTimeout(timeoutId);\n };\n }\n return undefined;\n }, [onExited, inProp, timeout]);\n return /*#__PURE__*/_jsx(\"span\", {\n className: rippleClassName,\n style: rippleStyles,\n children: /*#__PURE__*/_jsx(\"span\", {\n className: childClassName\n })\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? Ripple.propTypes = {\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n /**\n * @ignore - injected from TransitionGroup\n */\n in: PropTypes.bool,\n /**\n * @ignore - injected from TransitionGroup\n */\n onExited: PropTypes.func,\n /**\n * If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element.\n */\n pulsate: PropTypes.bool,\n /**\n * Diameter of the ripple.\n */\n rippleSize: PropTypes.number,\n /**\n * Horizontal position of the ripple center.\n */\n rippleX: PropTypes.number,\n /**\n * Vertical position of the ripple center.\n */\n rippleY: PropTypes.number,\n /**\n * exit delay\n */\n timeout: PropTypes.number.isRequired\n} : void 0;\nexport default Ripple;","import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nimport generateUtilityClass from '../generateUtilityClass';\nexport function getTouchRippleUtilityClass(slot) {\n return generateUtilityClass('MuiTouchRipple', slot);\n}\nconst touchRippleClasses = generateUtilityClasses('MuiTouchRipple', ['root', 'ripple', 'rippleVisible', 'ripplePulsate', 'child', 'childLeaving', 'childPulsate']);\nexport default touchRippleClasses;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"center\", \"classes\", \"className\"];\nlet _ = t => t,\n _t,\n _t2,\n _t3,\n _t4;\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { TransitionGroup } from 'react-transition-group';\nimport clsx from 'clsx';\nimport { keyframes } from '@mui/system';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport Ripple from './Ripple';\nimport touchRippleClasses from './touchRippleClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst DURATION = 550;\nexport const DELAY_RIPPLE = 80;\nconst enterKeyframe = keyframes(_t || (_t = _`\n 0% {\n transform: scale(0);\n opacity: 0.1;\n }\n\n 100% {\n transform: scale(1);\n opacity: 0.3;\n }\n`));\nconst exitKeyframe = keyframes(_t2 || (_t2 = _`\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n`));\nconst pulsateKeyframe = keyframes(_t3 || (_t3 = _`\n 0% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(0.92);\n }\n\n 100% {\n transform: scale(1);\n }\n`));\nexport const TouchRippleRoot = styled('span', {\n name: 'MuiTouchRipple',\n slot: 'Root'\n})({\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 0,\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: 'inherit'\n});\n\n// This `styled()` function invokes keyframes. `styled-components` only supports keyframes\n// in string templates. Do not convert these styles in JS object as it will break.\nexport const TouchRippleRipple = styled(Ripple, {\n name: 'MuiTouchRipple',\n slot: 'Ripple'\n})(_t4 || (_t4 = _`\n opacity: 0;\n position: absolute;\n\n &.${0} {\n opacity: 0.3;\n transform: scale(1);\n animation-name: ${0};\n animation-duration: ${0}ms;\n animation-timing-function: ${0};\n }\n\n &.${0} {\n animation-duration: ${0}ms;\n }\n\n & .${0} {\n opacity: 1;\n display: block;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: currentColor;\n }\n\n & .${0} {\n opacity: 0;\n animation-name: ${0};\n animation-duration: ${0}ms;\n animation-timing-function: ${0};\n }\n\n & .${0} {\n position: absolute;\n /* @noflip */\n left: 0px;\n top: 0;\n animation-name: ${0};\n animation-duration: 2500ms;\n animation-timing-function: ${0};\n animation-iteration-count: infinite;\n animation-delay: 200ms;\n }\n`), touchRippleClasses.rippleVisible, enterKeyframe, DURATION, ({\n theme\n}) => theme.transitions.easing.easeInOut, touchRippleClasses.ripplePulsate, ({\n theme\n}) => theme.transitions.duration.shorter, touchRippleClasses.child, touchRippleClasses.childLeaving, exitKeyframe, DURATION, ({\n theme\n}) => theme.transitions.easing.easeInOut, touchRippleClasses.childPulsate, pulsateKeyframe, ({\n theme\n}) => theme.transitions.easing.easeInOut);\n\n/**\n * @ignore - internal component.\n *\n * TODO v5: Make private\n */\nconst TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiTouchRipple'\n });\n const {\n center: centerProp = false,\n classes = {},\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const [ripples, setRipples] = React.useState([]);\n const nextKey = React.useRef(0);\n const rippleCallback = React.useRef(null);\n React.useEffect(() => {\n if (rippleCallback.current) {\n rippleCallback.current();\n rippleCallback.current = null;\n }\n }, [ripples]);\n\n // Used to filter out mouse emulated events on mobile.\n const ignoringMouseDown = React.useRef(false);\n // We use a timer in order to only show the ripples for touch \"click\" like events.\n // We don't want to display the ripple for touch scroll events.\n const startTimer = React.useRef(null);\n\n // This is the hook called once the previous timeout is ready.\n const startTimerCommit = React.useRef(null);\n const container = React.useRef(null);\n React.useEffect(() => {\n return () => {\n clearTimeout(startTimer.current);\n };\n }, []);\n const startCommit = React.useCallback(params => {\n const {\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n } = params;\n setRipples(oldRipples => [...oldRipples, /*#__PURE__*/_jsx(TouchRippleRipple, {\n classes: {\n ripple: clsx(classes.ripple, touchRippleClasses.ripple),\n rippleVisible: clsx(classes.rippleVisible, touchRippleClasses.rippleVisible),\n ripplePulsate: clsx(classes.ripplePulsate, touchRippleClasses.ripplePulsate),\n child: clsx(classes.child, touchRippleClasses.child),\n childLeaving: clsx(classes.childLeaving, touchRippleClasses.childLeaving),\n childPulsate: clsx(classes.childPulsate, touchRippleClasses.childPulsate)\n },\n timeout: DURATION,\n pulsate: pulsate,\n rippleX: rippleX,\n rippleY: rippleY,\n rippleSize: rippleSize\n }, nextKey.current)]);\n nextKey.current += 1;\n rippleCallback.current = cb;\n }, [classes]);\n const start = React.useCallback((event = {}, options = {}, cb = () => {}) => {\n const {\n pulsate = false,\n center = centerProp || options.pulsate,\n fakeElement = false // For test purposes\n } = options;\n if ((event == null ? void 0 : event.type) === 'mousedown' && ignoringMouseDown.current) {\n ignoringMouseDown.current = false;\n return;\n }\n if ((event == null ? void 0 : event.type) === 'touchstart') {\n ignoringMouseDown.current = true;\n }\n const element = fakeElement ? null : container.current;\n const rect = element ? element.getBoundingClientRect() : {\n width: 0,\n height: 0,\n left: 0,\n top: 0\n };\n\n // Get the size of the ripple\n let rippleX;\n let rippleY;\n let rippleSize;\n if (center || event === undefined || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {\n rippleX = Math.round(rect.width / 2);\n rippleY = Math.round(rect.height / 2);\n } else {\n const {\n clientX,\n clientY\n } = event.touches && event.touches.length > 0 ? event.touches[0] : event;\n rippleX = Math.round(clientX - rect.left);\n rippleY = Math.round(clientY - rect.top);\n }\n if (center) {\n rippleSize = Math.sqrt((2 * rect.width ** 2 + rect.height ** 2) / 3);\n\n // For some reason the animation is broken on Mobile Chrome if the size is even.\n if (rippleSize % 2 === 0) {\n rippleSize += 1;\n }\n } else {\n const sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;\n const sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;\n rippleSize = Math.sqrt(sizeX ** 2 + sizeY ** 2);\n }\n\n // Touche devices\n if (event != null && event.touches) {\n // check that this isn't another touchstart due to multitouch\n // otherwise we will only clear a single timer when unmounting while two\n // are running\n if (startTimerCommit.current === null) {\n // Prepare the ripple effect.\n startTimerCommit.current = () => {\n startCommit({\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n });\n };\n // Delay the execution of the ripple effect.\n startTimer.current = setTimeout(() => {\n if (startTimerCommit.current) {\n startTimerCommit.current();\n startTimerCommit.current = null;\n }\n }, DELAY_RIPPLE); // We have to make a tradeoff with this value.\n }\n } else {\n startCommit({\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n });\n }\n }, [centerProp, startCommit]);\n const pulsate = React.useCallback(() => {\n start({}, {\n pulsate: true\n });\n }, [start]);\n const stop = React.useCallback((event, cb) => {\n clearTimeout(startTimer.current);\n\n // The touch interaction occurs too quickly.\n // We still want to show ripple effect.\n if ((event == null ? void 0 : event.type) === 'touchend' && startTimerCommit.current) {\n startTimerCommit.current();\n startTimerCommit.current = null;\n startTimer.current = setTimeout(() => {\n stop(event, cb);\n });\n return;\n }\n startTimerCommit.current = null;\n setRipples(oldRipples => {\n if (oldRipples.length > 0) {\n return oldRipples.slice(1);\n }\n return oldRipples;\n });\n rippleCallback.current = cb;\n }, []);\n React.useImperativeHandle(ref, () => ({\n pulsate,\n start,\n stop\n }), [pulsate, start, stop]);\n return /*#__PURE__*/_jsx(TouchRippleRoot, _extends({\n className: clsx(touchRippleClasses.root, classes.root, className),\n ref: container\n }, other, {\n children: /*#__PURE__*/_jsx(TransitionGroup, {\n component: null,\n exit: true,\n children: ripples\n })\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? TouchRipple.propTypes = {\n /**\n * If `true`, the ripple starts at the center of the component\n * rather than at the point of interaction.\n */\n center: PropTypes.bool,\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string\n} : void 0;\nexport default TouchRipple;","import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nimport generateUtilityClass from '../generateUtilityClass';\nexport function getButtonBaseUtilityClass(slot) {\n return generateUtilityClass('MuiButtonBase', slot);\n}\nconst buttonBaseClasses = generateUtilityClasses('MuiButtonBase', ['root', 'disabled', 'focusVisible']);\nexport default buttonBaseClasses;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"action\", \"centerRipple\", \"children\", \"className\", \"component\", \"disabled\", \"disableRipple\", \"disableTouchRipple\", \"focusRipple\", \"focusVisibleClassName\", \"LinkComponent\", \"onBlur\", \"onClick\", \"onContextMenu\", \"onDragLeave\", \"onFocus\", \"onFocusVisible\", \"onKeyDown\", \"onKeyUp\", \"onMouseDown\", \"onMouseLeave\", \"onMouseUp\", \"onTouchEnd\", \"onTouchMove\", \"onTouchStart\", \"tabIndex\", \"TouchRippleProps\", \"touchRippleRef\", \"type\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { elementTypeAcceptingRef, refType } from '@mui/utils';\nimport composeClasses from '@mui/base/composeClasses';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport useForkRef from '../utils/useForkRef';\nimport useEventCallback from '../utils/useEventCallback';\nimport useIsFocusVisible from '../utils/useIsFocusVisible';\nimport TouchRipple from './TouchRipple';\nimport buttonBaseClasses, { getButtonBaseUtilityClass } from './buttonBaseClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n disabled,\n focusVisible,\n focusVisibleClassName,\n classes\n } = ownerState;\n const slots = {\n root: ['root', disabled && 'disabled', focusVisible && 'focusVisible']\n };\n const composedClasses = composeClasses(slots, getButtonBaseUtilityClass, classes);\n if (focusVisible && focusVisibleClassName) {\n composedClasses.root += ` ${focusVisibleClassName}`;\n }\n return composedClasses;\n};\nexport const ButtonBaseRoot = styled('button', {\n name: 'MuiButtonBase',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'relative',\n boxSizing: 'border-box',\n WebkitTapHighlightColor: 'transparent',\n backgroundColor: 'transparent',\n // Reset default value\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0,\n border: 0,\n margin: 0,\n // Remove the margin in Safari\n borderRadius: 0,\n padding: 0,\n // Remove the padding in Firefox\n cursor: 'pointer',\n userSelect: 'none',\n verticalAlign: 'middle',\n MozAppearance: 'none',\n // Reset\n WebkitAppearance: 'none',\n // Reset\n textDecoration: 'none',\n // So we take precedent over the style of a native element.\n color: 'inherit',\n '&::-moz-focus-inner': {\n borderStyle: 'none' // Remove Firefox dotted outline.\n },\n\n [`&.${buttonBaseClasses.disabled}`]: {\n pointerEvents: 'none',\n // Disable link interactions\n cursor: 'default'\n },\n '@media print': {\n colorAdjust: 'exact'\n }\n});\n\n/**\n * `ButtonBase` contains as few styles as possible.\n * It aims to be a simple building block for creating a button.\n * It contains a load of style reset and some focus/ripple logic.\n */\nconst ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiButtonBase'\n });\n const {\n action,\n centerRipple = false,\n children,\n className,\n component = 'button',\n disabled = false,\n disableRipple = false,\n disableTouchRipple = false,\n focusRipple = false,\n LinkComponent = 'a',\n onBlur,\n onClick,\n onContextMenu,\n onDragLeave,\n onFocus,\n onFocusVisible,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseLeave,\n onMouseUp,\n onTouchEnd,\n onTouchMove,\n onTouchStart,\n tabIndex = 0,\n TouchRippleProps,\n touchRippleRef,\n type\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const buttonRef = React.useRef(null);\n const rippleRef = React.useRef(null);\n const handleRippleRef = useForkRef(rippleRef, touchRippleRef);\n const {\n isFocusVisibleRef,\n onFocus: handleFocusVisible,\n onBlur: handleBlurVisible,\n ref: focusVisibleRef\n } = useIsFocusVisible();\n const [focusVisible, setFocusVisible] = React.useState(false);\n if (disabled && focusVisible) {\n setFocusVisible(false);\n }\n React.useImperativeHandle(action, () => ({\n focusVisible: () => {\n setFocusVisible(true);\n buttonRef.current.focus();\n }\n }), []);\n const [mountedState, setMountedState] = React.useState(false);\n React.useEffect(() => {\n setMountedState(true);\n }, []);\n const enableTouchRipple = mountedState && !disableRipple && !disabled;\n React.useEffect(() => {\n if (focusVisible && focusRipple && !disableRipple && mountedState) {\n rippleRef.current.pulsate();\n }\n }, [disableRipple, focusRipple, focusVisible, mountedState]);\n function useRippleHandler(rippleAction, eventCallback, skipRippleAction = disableTouchRipple) {\n return useEventCallback(event => {\n if (eventCallback) {\n eventCallback(event);\n }\n const ignore = skipRippleAction;\n if (!ignore && rippleRef.current) {\n rippleRef.current[rippleAction](event);\n }\n return true;\n });\n }\n const handleMouseDown = useRippleHandler('start', onMouseDown);\n const handleContextMenu = useRippleHandler('stop', onContextMenu);\n const handleDragLeave = useRippleHandler('stop', onDragLeave);\n const handleMouseUp = useRippleHandler('stop', onMouseUp);\n const handleMouseLeave = useRippleHandler('stop', event => {\n if (focusVisible) {\n event.preventDefault();\n }\n if (onMouseLeave) {\n onMouseLeave(event);\n }\n });\n const handleTouchStart = useRippleHandler('start', onTouchStart);\n const handleTouchEnd = useRippleHandler('stop', onTouchEnd);\n const handleTouchMove = useRippleHandler('stop', onTouchMove);\n const handleBlur = useRippleHandler('stop', event => {\n handleBlurVisible(event);\n if (isFocusVisibleRef.current === false) {\n setFocusVisible(false);\n }\n if (onBlur) {\n onBlur(event);\n }\n }, false);\n const handleFocus = useEventCallback(event => {\n // Fix for https://github.com/facebook/react/issues/7769\n if (!buttonRef.current) {\n buttonRef.current = event.currentTarget;\n }\n handleFocusVisible(event);\n if (isFocusVisibleRef.current === true) {\n setFocusVisible(true);\n if (onFocusVisible) {\n onFocusVisible(event);\n }\n }\n if (onFocus) {\n onFocus(event);\n }\n });\n const isNonNativeButton = () => {\n const button = buttonRef.current;\n return component && component !== 'button' && !(button.tagName === 'A' && button.href);\n };\n\n /**\n * IE11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat\n */\n const keydownRef = React.useRef(false);\n const handleKeyDown = useEventCallback(event => {\n // Check if key is already down to avoid repeats being counted as multiple activations\n if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {\n keydownRef.current = true;\n rippleRef.current.stop(event, () => {\n rippleRef.current.start(event);\n });\n }\n if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {\n event.preventDefault();\n }\n if (onKeyDown) {\n onKeyDown(event);\n }\n\n // Keyboard accessibility for non interactive elements\n if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {\n event.preventDefault();\n if (onClick) {\n onClick(event);\n }\n }\n });\n const handleKeyUp = useEventCallback(event => {\n // calling preventDefault in keyUp on a \n *
    \n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n\n var _proto = Transition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n if (nextStatus === ENTERING) {\n if (this.props.unmountOnExit || this.props.mountOnEnter) {\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749\n // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.\n // To make the animation happen, we have to separate each rendering and avoid being processed as batched.\n\n if (node) forceReflow(node);\n }\n\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n\n var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || config.disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit() {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || config.disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n\n return (\n /*#__PURE__*/\n // allows for nested Transitions\n React.createElement(TransitionGroupContext.Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))\n );\n };\n\n return Transition;\n}(React.Component);\n\nTransition.contextType = TransitionGroupContext;\nTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A React reference to DOM element that need to transition:\n * https://stackoverflow.com/a/51127130/4671932\n *\n * - When `nodeRef` prop is used, `node` is not passed to callback functions\n * (e.g. `onEnter`) because user already has direct access to the node.\n * - When changing `key` prop of `Transition` in a `TransitionGroup` a new\n * `nodeRef` need to be provided to `Transition` with changed `key` prop\n * (see\n * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).\n */\n nodeRef: PropTypes.shape({\n current: typeof Element === 'undefined' ? PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) {\n var value = propValue[key];\n return PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);\n }\n }),\n\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * \n * {state => (\n * \n * )}\n * \n * ```\n */\n children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: PropTypes.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: PropTypes.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: PropTypes.bool,\n\n /**\n * By default the child component does not perform the enter transition when\n * it first mounts, regardless of the value of `in`. If you want this\n * behavior, set both `appear` and `in` to `true`.\n *\n * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop\n * > only adds an additional enter transition. However, in the\n * > `` component that first enter transition does result in\n * > additional `.appear-*` classes, that way you can choose to style it\n * > differently.\n */\n appear: PropTypes.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = timeoutsShape;\n if (!props.addEndListener) pt = pt.isRequired;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. Timeouts are still used as a fallback if provided.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: PropTypes.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: PropTypes.func\n} : {}; // Name the function so it is clearer in the documentation\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\nexport default Transition;","export var forceReflow = function forceReflow(node) {\n return node.scrollTop;\n};","import * as React from 'react';\nimport { useTheme as useThemeSystem } from '@mui/system';\nimport defaultTheme from './defaultTheme';\nexport default function useTheme() {\n const theme = useThemeSystem(defaultTheme);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(theme);\n }\n return theme;\n}","export const reflow = node => node.scrollTop;\nexport function getTransitionProps(props, options) {\n var _style$transitionDura, _style$transitionTimi;\n const {\n timeout,\n easing,\n style = {}\n } = props;\n return {\n duration: (_style$transitionDura = style.transitionDuration) != null ? _style$transitionDura : typeof timeout === 'number' ? timeout : timeout[options.mode] || 0,\n easing: (_style$transitionTimi = style.transitionTimingFunction) != null ? _style$transitionTimi : typeof easing === 'object' ? easing[options.mode] : easing,\n delay: style.transitionDelay\n };\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"addEndListener\", \"appear\", \"children\", \"easing\", \"in\", \"onEnter\", \"onEntered\", \"onEntering\", \"onExit\", \"onExited\", \"onExiting\", \"style\", \"timeout\", \"TransitionComponent\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { elementAcceptingRef } from '@mui/utils';\nimport { Transition } from 'react-transition-group';\nimport useTheme from '../styles/useTheme';\nimport { getTransitionProps, reflow } from '../transitions/utils';\nimport useForkRef from '../utils/useForkRef';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction getScale(value) {\n return `scale(${value}, ${value ** 2})`;\n}\nconst styles = {\n entering: {\n opacity: 1,\n transform: getScale(1)\n },\n entered: {\n opacity: 1,\n transform: 'none'\n }\n};\n\n/*\n TODO v6: remove\n Conditionally apply a workaround for the CSS transition bug in Safari 15.4 / WebKit browsers.\n */\nconst isWebKit154 = typeof navigator !== 'undefined' && /^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) && /(os |version\\/)15(.|_)4/i.test(navigator.userAgent);\n\n/**\n * The Grow transition is used by the [Tooltip](/material-ui/react-tooltip/) and\n * [Popover](/material-ui/react-popover/) components.\n * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.\n */\nconst Grow = /*#__PURE__*/React.forwardRef(function Grow(props, ref) {\n const {\n addEndListener,\n appear = true,\n children,\n easing,\n in: inProp,\n onEnter,\n onEntered,\n onEntering,\n onExit,\n onExited,\n onExiting,\n style,\n timeout = 'auto',\n // eslint-disable-next-line react/prop-types\n TransitionComponent = Transition\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const timer = React.useRef();\n const autoTimeout = React.useRef();\n const theme = useTheme();\n const nodeRef = React.useRef(null);\n const handleRef = useForkRef(nodeRef, children.ref, ref);\n const normalizedTransitionCallback = callback => maybeIsAppearing => {\n if (callback) {\n const node = nodeRef.current;\n\n // onEnterXxx and onExitXxx callbacks have a different arguments.length value.\n if (maybeIsAppearing === undefined) {\n callback(node);\n } else {\n callback(node, maybeIsAppearing);\n }\n }\n };\n const handleEntering = normalizedTransitionCallback(onEntering);\n const handleEnter = normalizedTransitionCallback((node, isAppearing) => {\n reflow(node); // So the animation always start from the start.\n\n const {\n duration: transitionDuration,\n delay,\n easing: transitionTimingFunction\n } = getTransitionProps({\n style,\n timeout,\n easing\n }, {\n mode: 'enter'\n });\n let duration;\n if (timeout === 'auto') {\n duration = theme.transitions.getAutoHeightDuration(node.clientHeight);\n autoTimeout.current = duration;\n } else {\n duration = transitionDuration;\n }\n node.style.transition = [theme.transitions.create('opacity', {\n duration,\n delay\n }), theme.transitions.create('transform', {\n duration: isWebKit154 ? duration : duration * 0.666,\n delay,\n easing: transitionTimingFunction\n })].join(',');\n if (onEnter) {\n onEnter(node, isAppearing);\n }\n });\n const handleEntered = normalizedTransitionCallback(onEntered);\n const handleExiting = normalizedTransitionCallback(onExiting);\n const handleExit = normalizedTransitionCallback(node => {\n const {\n duration: transitionDuration,\n delay,\n easing: transitionTimingFunction\n } = getTransitionProps({\n style,\n timeout,\n easing\n }, {\n mode: 'exit'\n });\n let duration;\n if (timeout === 'auto') {\n duration = theme.transitions.getAutoHeightDuration(node.clientHeight);\n autoTimeout.current = duration;\n } else {\n duration = transitionDuration;\n }\n node.style.transition = [theme.transitions.create('opacity', {\n duration,\n delay\n }), theme.transitions.create('transform', {\n duration: isWebKit154 ? duration : duration * 0.666,\n delay: isWebKit154 ? delay : delay || duration * 0.333,\n easing: transitionTimingFunction\n })].join(',');\n node.style.opacity = 0;\n node.style.transform = getScale(0.75);\n if (onExit) {\n onExit(node);\n }\n });\n const handleExited = normalizedTransitionCallback(onExited);\n const handleAddEndListener = next => {\n if (timeout === 'auto') {\n timer.current = setTimeout(next, autoTimeout.current || 0);\n }\n if (addEndListener) {\n // Old call signature before `react-transition-group` implemented `nodeRef`\n addEndListener(nodeRef.current, next);\n }\n };\n React.useEffect(() => {\n return () => {\n clearTimeout(timer.current);\n };\n }, []);\n return /*#__PURE__*/_jsx(TransitionComponent, _extends({\n appear: appear,\n in: inProp,\n nodeRef: nodeRef,\n onEnter: handleEnter,\n onEntered: handleEntered,\n onEntering: handleEntering,\n onExit: handleExit,\n onExited: handleExited,\n onExiting: handleExiting,\n addEndListener: handleAddEndListener,\n timeout: timeout === 'auto' ? null : timeout\n }, other, {\n children: (state, childProps) => {\n return /*#__PURE__*/React.cloneElement(children, _extends({\n style: _extends({\n opacity: 0,\n transform: getScale(0.75),\n visibility: state === 'exited' && !inProp ? 'hidden' : undefined\n }, styles[state], style, children.props.style),\n ref: handleRef\n }, childProps));\n }\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? Grow.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Add a custom transition end trigger. Called with the transitioning DOM\n * node and a done callback. Allows for more fine grained transition end\n * logic. Note: Timeouts are still used as a fallback if provided.\n */\n addEndListener: PropTypes.func,\n /**\n * Perform the enter transition when it first mounts if `in` is also `true`.\n * Set this to `false` to disable this behavior.\n * @default true\n */\n appear: PropTypes.bool,\n /**\n * A single child content element.\n */\n children: elementAcceptingRef.isRequired,\n /**\n * The transition timing function.\n * You may specify a single easing or a object containing enter and exit values.\n */\n easing: PropTypes.oneOfType([PropTypes.shape({\n enter: PropTypes.string,\n exit: PropTypes.string\n }), PropTypes.string]),\n /**\n * If `true`, the component will transition in.\n */\n in: PropTypes.bool,\n /**\n * @ignore\n */\n onEnter: PropTypes.func,\n /**\n * @ignore\n */\n onEntered: PropTypes.func,\n /**\n * @ignore\n */\n onEntering: PropTypes.func,\n /**\n * @ignore\n */\n onExit: PropTypes.func,\n /**\n * @ignore\n */\n onExited: PropTypes.func,\n /**\n * @ignore\n */\n onExiting: PropTypes.func,\n /**\n * @ignore\n */\n style: PropTypes.object,\n /**\n * The duration for the transition, in milliseconds.\n * You may specify a single timeout for all transitions, or individually with an object.\n *\n * Set to 'auto' to automatically calculate transition time based on height.\n * @default 'auto'\n */\n timeout: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.shape({\n appear: PropTypes.number,\n enter: PropTypes.number,\n exit: PropTypes.number\n })])\n} : void 0;\nGrow.muiSupportAuto = true;\nexport default Grow;","import { unstable_ownerWindow as ownerWindow, unstable_ownerDocument as ownerDocument, unstable_getScrollbarSize as getScrollbarSize } from '@mui/utils';\n// Is a vertical scrollbar displayed?\nfunction isOverflowing(container) {\n const doc = ownerDocument(container);\n if (doc.body === container) {\n return ownerWindow(container).innerWidth > doc.documentElement.clientWidth;\n }\n return container.scrollHeight > container.clientHeight;\n}\nexport function ariaHidden(element, show) {\n if (show) {\n element.setAttribute('aria-hidden', 'true');\n } else {\n element.removeAttribute('aria-hidden');\n }\n}\nfunction getPaddingRight(element) {\n return parseInt(ownerWindow(element).getComputedStyle(element).paddingRight, 10) || 0;\n}\nfunction isAriaHiddenForbiddenOnElement(element) {\n // The forbidden HTML tags are the ones from ARIA specification that\n // can be children of body and can't have aria-hidden attribute.\n // cf. https://www.w3.org/TR/html-aria/#docconformance\n const forbiddenTagNames = ['TEMPLATE', 'SCRIPT', 'STYLE', 'LINK', 'MAP', 'META', 'NOSCRIPT', 'PICTURE', 'COL', 'COLGROUP', 'PARAM', 'SLOT', 'SOURCE', 'TRACK'];\n const isForbiddenTagName = forbiddenTagNames.indexOf(element.tagName) !== -1;\n const isInputHidden = element.tagName === 'INPUT' && element.getAttribute('type') === 'hidden';\n return isForbiddenTagName || isInputHidden;\n}\nfunction ariaHiddenSiblings(container, mountElement, currentElement, elementsToExclude, show) {\n const blacklist = [mountElement, currentElement, ...elementsToExclude];\n [].forEach.call(container.children, element => {\n const isNotExcludedElement = blacklist.indexOf(element) === -1;\n const isNotForbiddenElement = !isAriaHiddenForbiddenOnElement(element);\n if (isNotExcludedElement && isNotForbiddenElement) {\n ariaHidden(element, show);\n }\n });\n}\nfunction findIndexOf(items, callback) {\n let idx = -1;\n items.some((item, index) => {\n if (callback(item)) {\n idx = index;\n return true;\n }\n return false;\n });\n return idx;\n}\nfunction handleContainer(containerInfo, props) {\n const restoreStyle = [];\n const container = containerInfo.container;\n if (!props.disableScrollLock) {\n if (isOverflowing(container)) {\n // Compute the size before applying overflow hidden to avoid any scroll jumps.\n const scrollbarSize = getScrollbarSize(ownerDocument(container));\n restoreStyle.push({\n value: container.style.paddingRight,\n property: 'padding-right',\n el: container\n });\n // Use computed style, here to get the real padding to add our scrollbar width.\n container.style.paddingRight = `${getPaddingRight(container) + scrollbarSize}px`;\n\n // .mui-fixed is a global helper.\n const fixedElements = ownerDocument(container).querySelectorAll('.mui-fixed');\n [].forEach.call(fixedElements, element => {\n restoreStyle.push({\n value: element.style.paddingRight,\n property: 'padding-right',\n el: element\n });\n element.style.paddingRight = `${getPaddingRight(element) + scrollbarSize}px`;\n });\n }\n let scrollContainer;\n if (container.parentNode instanceof DocumentFragment) {\n scrollContainer = ownerDocument(container).body;\n } else {\n // Improve Gatsby support\n // https://css-tricks.com/snippets/css/force-vertical-scrollbar/\n const parent = container.parentElement;\n const containerWindow = ownerWindow(container);\n scrollContainer = (parent == null ? void 0 : parent.nodeName) === 'HTML' && containerWindow.getComputedStyle(parent).overflowY === 'scroll' ? parent : container;\n }\n\n // Block the scroll even if no scrollbar is visible to account for mobile keyboard\n // screensize shrink.\n restoreStyle.push({\n value: scrollContainer.style.overflow,\n property: 'overflow',\n el: scrollContainer\n }, {\n value: scrollContainer.style.overflowX,\n property: 'overflow-x',\n el: scrollContainer\n }, {\n value: scrollContainer.style.overflowY,\n property: 'overflow-y',\n el: scrollContainer\n });\n scrollContainer.style.overflow = 'hidden';\n }\n const restore = () => {\n restoreStyle.forEach(({\n value,\n el,\n property\n }) => {\n if (value) {\n el.style.setProperty(property, value);\n } else {\n el.style.removeProperty(property);\n }\n });\n };\n return restore;\n}\nfunction getHiddenSiblings(container) {\n const hiddenSiblings = [];\n [].forEach.call(container.children, element => {\n if (element.getAttribute('aria-hidden') === 'true') {\n hiddenSiblings.push(element);\n }\n });\n return hiddenSiblings;\n}\n/**\n * @ignore - do not document.\n *\n * Proper state management for containers and the modals in those containers.\n * Simplified, but inspired by react-overlay's ModalManager class.\n * Used by the Modal to ensure proper styling of containers.\n */\nexport default class ModalManager {\n constructor() {\n this.containers = void 0;\n this.modals = void 0;\n this.modals = [];\n this.containers = [];\n }\n add(modal, container) {\n let modalIndex = this.modals.indexOf(modal);\n if (modalIndex !== -1) {\n return modalIndex;\n }\n modalIndex = this.modals.length;\n this.modals.push(modal);\n\n // If the modal we are adding is already in the DOM.\n if (modal.modalRef) {\n ariaHidden(modal.modalRef, false);\n }\n const hiddenSiblings = getHiddenSiblings(container);\n ariaHiddenSiblings(container, modal.mount, modal.modalRef, hiddenSiblings, true);\n const containerIndex = findIndexOf(this.containers, item => item.container === container);\n if (containerIndex !== -1) {\n this.containers[containerIndex].modals.push(modal);\n return modalIndex;\n }\n this.containers.push({\n modals: [modal],\n container,\n restore: null,\n hiddenSiblings\n });\n return modalIndex;\n }\n mount(modal, props) {\n const containerIndex = findIndexOf(this.containers, item => item.modals.indexOf(modal) !== -1);\n const containerInfo = this.containers[containerIndex];\n if (!containerInfo.restore) {\n containerInfo.restore = handleContainer(containerInfo, props);\n }\n }\n remove(modal, ariaHiddenState = true) {\n const modalIndex = this.modals.indexOf(modal);\n if (modalIndex === -1) {\n return modalIndex;\n }\n const containerIndex = findIndexOf(this.containers, item => item.modals.indexOf(modal) !== -1);\n const containerInfo = this.containers[containerIndex];\n containerInfo.modals.splice(containerInfo.modals.indexOf(modal), 1);\n this.modals.splice(modalIndex, 1);\n\n // If that was the last modal in a container, clean up the container.\n if (containerInfo.modals.length === 0) {\n // The modal might be closed before it had the chance to be mounted in the DOM.\n if (containerInfo.restore) {\n containerInfo.restore();\n }\n if (modal.modalRef) {\n // In case the modal wasn't in the DOM yet.\n ariaHidden(modal.modalRef, ariaHiddenState);\n }\n ariaHiddenSiblings(containerInfo.container, modal.mount, modal.modalRef, containerInfo.hiddenSiblings, false);\n this.containers.splice(containerIndex, 1);\n } else {\n // Otherwise make sure the next top modal is visible to a screen reader.\n const nextTop = containerInfo.modals[containerInfo.modals.length - 1];\n // as soon as a modal is adding its modalRef is undefined. it can't set\n // aria-hidden because the dom element doesn't exist either\n // when modal was unmounted before modalRef gets null\n if (nextTop.modalRef) {\n ariaHidden(nextTop.modalRef, false);\n }\n }\n return modalIndex;\n }\n isTopModal(modal) {\n return this.modals.length > 0 && this.modals[this.modals.length - 1] === modal;\n }\n}","/* eslint-disable consistent-return, jsx-a11y/no-noninteractive-tabindex */\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { exactProp, elementAcceptingRef, unstable_useForkRef as useForkRef, unstable_ownerDocument as ownerDocument } from '@mui/utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n// Inspired by https://github.com/focus-trap/tabbable\nconst candidatesSelector = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable=\"false\"])'].join(',');\nfunction getTabIndex(node) {\n const tabindexAttr = parseInt(node.getAttribute('tabindex') || '', 10);\n if (!Number.isNaN(tabindexAttr)) {\n return tabindexAttr;\n }\n\n // Browsers do not return `tabIndex` correctly for contentEditable nodes;\n // https://bugs.chromium.org/p/chromium/issues/detail?id=661108&q=contenteditable%20tabindex&can=2\n // so if they don't have a tabindex attribute specifically set, assume it's 0.\n // in Chrome,
    , \n );\n};\n","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nimport generateUtilityClass from '../generateUtilityClass';\nexport function getTypographyUtilityClass(slot) {\n return generateUtilityClass('MuiTypography', slot);\n}\nconst typographyClasses = generateUtilityClasses('MuiTypography', ['root', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1', 'subtitle2', 'body1', 'body2', 'inherit', 'button', 'caption', 'overline', 'alignLeft', 'alignRight', 'alignCenter', 'alignJustify', 'noWrap', 'gutterBottom', 'paragraph']);\nexport default typographyClasses;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"align\", \"className\", \"component\", \"gutterBottom\", \"noWrap\", \"paragraph\", \"variant\", \"variantMapping\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_extendSxProp as extendSxProp } from '@mui/system';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport capitalize from '../utils/capitalize';\nimport { getTypographyUtilityClass } from './typographyClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n align,\n gutterBottom,\n noWrap,\n paragraph,\n variant,\n classes\n } = ownerState;\n const slots = {\n root: ['root', variant, ownerState.align !== 'inherit' && `align${capitalize(align)}`, gutterBottom && 'gutterBottom', noWrap && 'noWrap', paragraph && 'paragraph']\n };\n return composeClasses(slots, getTypographyUtilityClass, classes);\n};\nexport const TypographyRoot = styled('span', {\n name: 'MuiTypography',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== 'inherit' && styles[`align${capitalize(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom, ownerState.paragraph && styles.paragraph];\n }\n})(({\n theme,\n ownerState\n}) => _extends({\n margin: 0\n}, ownerState.variant && theme.typography[ownerState.variant], ownerState.align !== 'inherit' && {\n textAlign: ownerState.align\n}, ownerState.noWrap && {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap'\n}, ownerState.gutterBottom && {\n marginBottom: '0.35em'\n}, ownerState.paragraph && {\n marginBottom: 16\n}));\nconst defaultVariantMapping = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n subtitle1: 'h6',\n subtitle2: 'h6',\n body1: 'p',\n body2: 'p',\n inherit: 'p'\n};\n\n// TODO v6: deprecate these color values in v5.x and remove the transformation in v6\nconst colorTransformations = {\n primary: 'primary.main',\n textPrimary: 'text.primary',\n secondary: 'secondary.main',\n textSecondary: 'text.secondary',\n error: 'error.main'\n};\nconst transformDeprecatedColors = color => {\n return colorTransformations[color] || color;\n};\nconst Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, ref) {\n const themeProps = useThemeProps({\n props: inProps,\n name: 'MuiTypography'\n });\n const color = transformDeprecatedColors(themeProps.color);\n const props = extendSxProp(_extends({}, themeProps, {\n color\n }));\n const {\n align = 'inherit',\n className,\n component,\n gutterBottom = false,\n noWrap = false,\n paragraph = false,\n variant = 'body1',\n variantMapping = defaultVariantMapping\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n align,\n color,\n className,\n component,\n gutterBottom,\n noWrap,\n paragraph,\n variant,\n variantMapping\n });\n const Component = component || (paragraph ? 'p' : variantMapping[variant] || defaultVariantMapping[variant]) || 'span';\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(TypographyRoot, _extends({\n as: Component,\n ref: ref,\n ownerState: ownerState,\n className: clsx(classes.root, className)\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? Typography.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Set the text-align on the component.\n * @default 'inherit'\n */\n align: PropTypes.oneOf(['center', 'inherit', 'justify', 'left', 'right']),\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * If `true`, the text will have a bottom margin.\n * @default false\n */\n gutterBottom: PropTypes.bool,\n /**\n * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.\n *\n * Note that text overflow can only happen with block or inline-block level elements\n * (the element needs to have a width in order to overflow).\n * @default false\n */\n noWrap: PropTypes.bool,\n /**\n * If `true`, the element will be a paragraph element.\n * @default false\n */\n paragraph: PropTypes.bool,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * Applies the theme typography styles.\n * @default 'body1'\n */\n variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['body1', 'body2', 'button', 'caption', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'inherit', 'overline', 'subtitle1', 'subtitle2']), PropTypes.string]),\n /**\n * The component maps the variant prop to a range of different HTML element types.\n * For instance, subtitle1 to `
    `.\n * If you wish to change that mapping, you can provide your own.\n * Alternatively, you can use the `component` prop.\n * @default {\n * h1: 'h1',\n * h2: 'h2',\n * h3: 'h3',\n * h4: 'h4',\n * h5: 'h5',\n * h6: 'h6',\n * subtitle1: 'h6',\n * subtitle2: 'h6',\n * body1: 'p',\n * body2: 'p',\n * inherit: 'p',\n * }\n */\n variantMapping: PropTypes /* @typescript-to-proptypes-ignore */.object\n} : void 0;\nexport default Typography;","import * as React from 'react';\nimport Typography from '@mui/material/Typography';\nimport Box from '@mui/material/Box';\n\ninterface TabPanelProps {\n children?: React.ReactNode;\n index: number;\n value: number;\n}\n\nfunction TabPanel(props: TabPanelProps) {\n const { children, value, index, ...other } = props;\n\n return (\n
    \n );\n}\n\nexport default TabPanel;\n","import getPrototypeOf from \"./getPrototypeOf.js\";\nexport default function _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}","import superPropBase from \"./superPropBase.js\";\nexport default function _get() {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n _get = Reflect.get;\n } else {\n _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(arguments.length < 3 ? target : receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get.apply(this, arguments);\n}","/*!\n * Chart.js v3.7.1\n * https://www.chartjs.org\n * (c) 2022 Chart.js Contributors\n * Released under the MIT License\n */\nfunction fontString(pixelSize, fontStyle, fontFamily) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\nconst requestAnimFrame = (function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n return callback();\n };\n }\n return window.requestAnimationFrame;\n}());\nfunction throttled(fn, thisArg, updateFn) {\n const updateArgs = updateFn || ((args) => Array.prototype.slice.call(args));\n let ticking = false;\n let args = [];\n return function(...rest) {\n args = updateArgs(rest);\n if (!ticking) {\n ticking = true;\n requestAnimFrame.call(window, () => {\n ticking = false;\n fn.apply(thisArg, args);\n });\n }\n };\n}\nfunction debounce(fn, delay) {\n let timeout;\n return function(...args) {\n if (delay) {\n clearTimeout(timeout);\n timeout = setTimeout(fn, delay, args);\n } else {\n fn.apply(this, args);\n }\n return delay;\n };\n}\nconst _toLeftRightCenter = (align) => align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\nconst _alignStartEnd = (align, start, end) => align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\nconst _textX = (align, left, right, rtl) => {\n const check = rtl ? 'left' : 'right';\n return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\n\nfunction noop() {}\nconst uid = (function() {\n let id = 0;\n return function() {\n return id++;\n };\n}());\nfunction isNullOrUndef(value) {\n return value === null || typeof value === 'undefined';\n}\nfunction isArray(value) {\n if (Array.isArray && Array.isArray(value)) {\n return true;\n }\n const type = Object.prototype.toString.call(value);\n if (type.substr(0, 7) === '[object' && type.substr(-6) === 'Array]') {\n return true;\n }\n return false;\n}\nfunction isObject(value) {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\nconst isNumberFinite = (value) => (typeof value === 'number' || value instanceof Number) && isFinite(+value);\nfunction finiteOrDefault(value, defaultValue) {\n return isNumberFinite(value) ? value : defaultValue;\n}\nfunction valueOrDefault(value, defaultValue) {\n return typeof value === 'undefined' ? defaultValue : value;\n}\nconst toPercentage = (value, dimension) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100\n : value / dimension;\nconst toDimension = (value, dimension) =>\n typeof value === 'string' && value.endsWith('%') ?\n parseFloat(value) / 100 * dimension\n : +value;\nfunction callback(fn, args, thisArg) {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n}\nfunction each(loopable, fn, thisArg, reverse) {\n let i, len, keys;\n if (isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for (i = len - 1; i >= 0; i--) {\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n}\nfunction _elementsEqual(a0, a1) {\n let i, ilen, v0, v1;\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n for (i = 0, ilen = a0.length; i < ilen; ++i) {\n v0 = a0[i];\n v1 = a1[i];\n if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n return false;\n }\n }\n return true;\n}\nfunction clone$1(source) {\n if (isArray(source)) {\n return source.map(clone$1);\n }\n if (isObject(source)) {\n const target = Object.create(null);\n const keys = Object.keys(source);\n const klen = keys.length;\n let k = 0;\n for (; k < klen; ++k) {\n target[keys[k]] = clone$1(source[keys[k]]);\n }\n return target;\n }\n return source;\n}\nfunction isValidKey(key) {\n return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;\n}\nfunction _merger(key, target, source, options) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n merge(tval, sval, options);\n } else {\n target[key] = clone$1(sval);\n }\n}\nfunction merge(target, source, options) {\n const sources = isArray(source) ? source : [source];\n const ilen = sources.length;\n if (!isObject(target)) {\n return target;\n }\n options = options || {};\n const merger = options.merger || _merger;\n for (let i = 0; i < ilen; ++i) {\n source = sources[i];\n if (!isObject(source)) {\n continue;\n }\n const keys = Object.keys(source);\n for (let k = 0, klen = keys.length; k < klen; ++k) {\n merger(keys[k], target, source, options);\n }\n }\n return target;\n}\nfunction mergeIf(target, source) {\n return merge(target, source, {merger: _mergerIf});\n}\nfunction _mergerIf(key, target, source) {\n if (!isValidKey(key)) {\n return;\n }\n const tval = target[key];\n const sval = source[key];\n if (isObject(tval) && isObject(sval)) {\n mergeIf(tval, sval);\n } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n target[key] = clone$1(sval);\n }\n}\nfunction _deprecated(scope, value, previous, current) {\n if (value !== undefined) {\n console.warn(scope + ': \"' + previous +\n\t\t\t'\" is deprecated. Please use \"' + current + '\" instead');\n }\n}\nconst emptyString = '';\nconst dot = '.';\nfunction indexOfDotOrLength(key, start) {\n const idx = key.indexOf(dot, start);\n return idx === -1 ? key.length : idx;\n}\nfunction resolveObjectKey(obj, key) {\n if (key === emptyString) {\n return obj;\n }\n let pos = 0;\n let idx = indexOfDotOrLength(key, pos);\n while (obj && idx > pos) {\n obj = obj[key.substr(pos, idx - pos)];\n pos = idx + 1;\n idx = indexOfDotOrLength(key, pos);\n }\n return obj;\n}\nfunction _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\nconst defined = (value) => typeof value !== 'undefined';\nconst isFunction = (value) => typeof value === 'function';\nconst setsEqual = (a, b) => {\n if (a.size !== b.size) {\n return false;\n }\n for (const item of a) {\n if (!b.has(item)) {\n return false;\n }\n }\n return true;\n};\nfunction _isClickEvent(e) {\n return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n\nconst PI = Math.PI;\nconst TAU = 2 * PI;\nconst PITAU = TAU + PI;\nconst INFINITY = Number.POSITIVE_INFINITY;\nconst RAD_PER_DEG = PI / 180;\nconst HALF_PI = PI / 2;\nconst QUARTER_PI = PI / 4;\nconst TWO_THIRDS_PI = PI * 2 / 3;\nconst log10 = Math.log10;\nconst sign = Math.sign;\nfunction niceNum(range) {\n const roundedRange = Math.round(range);\n range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n const niceRange = Math.pow(10, Math.floor(log10(range)));\n const fraction = range / niceRange;\n const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n return niceFraction * niceRange;\n}\nfunction _factorize(value) {\n const result = [];\n const sqrt = Math.sqrt(value);\n let i;\n for (i = 1; i < sqrt; i++) {\n if (value % i === 0) {\n result.push(i);\n result.push(value / i);\n }\n }\n if (sqrt === (sqrt | 0)) {\n result.push(sqrt);\n }\n result.sort((a, b) => a - b).pop();\n return result;\n}\nfunction isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\nfunction almostEquals(x, y, epsilon) {\n return Math.abs(x - y) < epsilon;\n}\nfunction almostWhole(x, epsilon) {\n const rounded = Math.round(x);\n return ((rounded - epsilon) <= x) && ((rounded + epsilon) >= x);\n}\nfunction _setMinAndMaxByKey(array, target, property) {\n let i, ilen, value;\n for (i = 0, ilen = array.length; i < ilen; i++) {\n value = array[i][property];\n if (!isNaN(value)) {\n target.min = Math.min(target.min, value);\n target.max = Math.max(target.max, value);\n }\n }\n}\nfunction toRadians(degrees) {\n return degrees * (PI / 180);\n}\nfunction toDegrees(radians) {\n return radians * (180 / PI);\n}\nfunction _decimalPlaces(x) {\n if (!isNumberFinite(x)) {\n return;\n }\n let e = 1;\n let p = 0;\n while (Math.round(x * e) / e !== x) {\n e *= 10;\n p++;\n }\n return p;\n}\nfunction getAngleFromPoint(centrePoint, anglePoint) {\n const distanceFromXCenter = anglePoint.x - centrePoint.x;\n const distanceFromYCenter = anglePoint.y - centrePoint.y;\n const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n if (angle < (-0.5 * PI)) {\n angle += TAU;\n }\n return {\n angle,\n distance: radialDistanceFromCenter\n };\n}\nfunction distanceBetweenPoints(pt1, pt2) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\nfunction _angleDiff(a, b) {\n return (a - b + PITAU) % TAU - PI;\n}\nfunction _normalizeAngle(a) {\n return (a % TAU + TAU) % TAU;\n}\nfunction _angleBetween(angle, start, end, sameAngleIsFullCircle) {\n const a = _normalizeAngle(angle);\n const s = _normalizeAngle(start);\n const e = _normalizeAngle(end);\n const angleToStart = _normalizeAngle(s - a);\n const angleToEnd = _normalizeAngle(e - a);\n const startToAngle = _normalizeAngle(a - s);\n const endToAngle = _normalizeAngle(a - e);\n return a === s || a === e || (sameAngleIsFullCircle && s === e)\n || (angleToStart > angleToEnd && startToAngle < endToAngle);\n}\nfunction _limitValue(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\nfunction _int16Range(value) {\n return _limitValue(value, -32768, 32767);\n}\nfunction _isBetween(value, start, end, epsilon = 1e-6) {\n return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n\nconst atEdge = (t) => t === 0 || t === 1;\nconst elasticIn = (t, s, p) => -(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t, s, p) => Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\nconst effects = {\n linear: t => t,\n easeInQuad: t => t * t,\n easeOutQuad: t => -t * (t - 2),\n easeInOutQuad: t => ((t /= 0.5) < 1)\n ? 0.5 * t * t\n : -0.5 * ((--t) * (t - 2) - 1),\n easeInCubic: t => t * t * t,\n easeOutCubic: t => (t -= 1) * t * t + 1,\n easeInOutCubic: t => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t\n : 0.5 * ((t -= 2) * t * t + 2),\n easeInQuart: t => t * t * t * t,\n easeOutQuart: t => -((t -= 1) * t * t * t - 1),\n easeInOutQuart: t => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t\n : -0.5 * ((t -= 2) * t * t * t - 2),\n easeInQuint: t => t * t * t * t * t,\n easeOutQuint: t => (t -= 1) * t * t * t * t + 1,\n easeInOutQuint: t => ((t /= 0.5) < 1)\n ? 0.5 * t * t * t * t * t\n : 0.5 * ((t -= 2) * t * t * t * t + 2),\n easeInSine: t => -Math.cos(t * HALF_PI) + 1,\n easeOutSine: t => Math.sin(t * HALF_PI),\n easeInOutSine: t => -0.5 * (Math.cos(PI * t) - 1),\n easeInExpo: t => (t === 0) ? 0 : Math.pow(2, 10 * (t - 1)),\n easeOutExpo: t => (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1,\n easeInOutExpo: t => atEdge(t) ? t : t < 0.5\n ? 0.5 * Math.pow(2, 10 * (t * 2 - 1))\n : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n easeInCirc: t => (t >= 1) ? t : -(Math.sqrt(1 - t * t) - 1),\n easeOutCirc: t => Math.sqrt(1 - (t -= 1) * t),\n easeInOutCirc: t => ((t /= 0.5) < 1)\n ? -0.5 * (Math.sqrt(1 - t * t) - 1)\n : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n easeInElastic: t => atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n easeOutElastic: t => atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n easeInOutElastic(t) {\n const s = 0.1125;\n const p = 0.45;\n return atEdge(t) ? t :\n t < 0.5\n ? 0.5 * elasticIn(t * 2, s, p)\n : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n },\n easeInBack(t) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n easeOutBack(t) {\n const s = 1.70158;\n return (t -= 1) * t * ((s + 1) * t + s) + 1;\n },\n easeInOutBack(t) {\n let s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\n },\n easeInBounce: t => 1 - effects.easeOutBounce(1 - t),\n easeOutBounce(t) {\n const m = 7.5625;\n const d = 2.75;\n if (t < (1 / d)) {\n return m * t * t;\n }\n if (t < (2 / d)) {\n return m * (t -= (1.5 / d)) * t + 0.75;\n }\n if (t < (2.5 / d)) {\n return m * (t -= (2.25 / d)) * t + 0.9375;\n }\n return m * (t -= (2.625 / d)) * t + 0.984375;\n },\n easeInOutBounce: t => (t < 0.5)\n ? effects.easeInBounce(t * 2) * 0.5\n : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5,\n};\n\n/*!\n * @kurkle/color v0.1.9\n * https://github.com/kurkle/color#readme\n * (c) 2020 Jukka Kurkela\n * Released under the MIT License\n */\nconst map = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15};\nconst hex = '0123456789ABCDEF';\nconst h1 = (b) => hex[b & 0xF];\nconst h2 = (b) => hex[(b & 0xF0) >> 4] + hex[b & 0xF];\nconst eq = (b) => (((b & 0xF0) >> 4) === (b & 0xF));\nfunction isShort(v) {\n\treturn eq(v.r) && eq(v.g) && eq(v.b) && eq(v.a);\n}\nfunction hexParse(str) {\n\tvar len = str.length;\n\tvar ret;\n\tif (str[0] === '#') {\n\t\tif (len === 4 || len === 5) {\n\t\t\tret = {\n\t\t\t\tr: 255 & map[str[1]] * 17,\n\t\t\t\tg: 255 & map[str[2]] * 17,\n\t\t\t\tb: 255 & map[str[3]] * 17,\n\t\t\t\ta: len === 5 ? map[str[4]] * 17 : 255\n\t\t\t};\n\t\t} else if (len === 7 || len === 9) {\n\t\t\tret = {\n\t\t\t\tr: map[str[1]] << 4 | map[str[2]],\n\t\t\t\tg: map[str[3]] << 4 | map[str[4]],\n\t\t\t\tb: map[str[5]] << 4 | map[str[6]],\n\t\t\t\ta: len === 9 ? (map[str[7]] << 4 | map[str[8]]) : 255\n\t\t\t};\n\t\t}\n\t}\n\treturn ret;\n}\nfunction hexString(v) {\n\tvar f = isShort(v) ? h1 : h2;\n\treturn v\n\t\t? '#' + f(v.r) + f(v.g) + f(v.b) + (v.a < 255 ? f(v.a) : '')\n\t\t: v;\n}\nfunction round(v) {\n\treturn v + 0.5 | 0;\n}\nconst lim = (v, l, h) => Math.max(Math.min(v, h), l);\nfunction p2b(v) {\n\treturn lim(round(v * 2.55), 0, 255);\n}\nfunction n2b(v) {\n\treturn lim(round(v * 255), 0, 255);\n}\nfunction b2n(v) {\n\treturn lim(round(v / 2.55) / 100, 0, 1);\n}\nfunction n2p(v) {\n\treturn lim(round(v * 100), 0, 100);\n}\nconst RGB_RE = /^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction rgbParse(str) {\n\tconst m = RGB_RE.exec(str);\n\tlet a = 255;\n\tlet r, g, b;\n\tif (!m) {\n\t\treturn;\n\t}\n\tif (m[7] !== r) {\n\t\tconst v = +m[7];\n\t\ta = 255 & (m[8] ? p2b(v) : v * 255);\n\t}\n\tr = +m[1];\n\tg = +m[3];\n\tb = +m[5];\n\tr = 255 & (m[2] ? p2b(r) : r);\n\tg = 255 & (m[4] ? p2b(g) : g);\n\tb = 255 & (m[6] ? p2b(b) : b);\n\treturn {\n\t\tr: r,\n\t\tg: g,\n\t\tb: b,\n\t\ta: a\n\t};\n}\nfunction rgbString(v) {\n\treturn v && (\n\t\tv.a < 255\n\t\t\t? `rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`\n\t\t\t: `rgb(${v.r}, ${v.g}, ${v.b})`\n\t);\n}\nconst HUE_RE = /^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction hsl2rgbn(h, s, l) {\n\tconst a = s * Math.min(l, 1 - l);\n\tconst f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n\treturn [f(0), f(8), f(4)];\n}\nfunction hsv2rgbn(h, s, v) {\n\tconst f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n\treturn [f(5), f(3), f(1)];\n}\nfunction hwb2rgbn(h, w, b) {\n\tconst rgb = hsl2rgbn(h, 1, 0.5);\n\tlet i;\n\tif (w + b > 1) {\n\t\ti = 1 / (w + b);\n\t\tw *= i;\n\t\tb *= i;\n\t}\n\tfor (i = 0; i < 3; i++) {\n\t\trgb[i] *= 1 - w - b;\n\t\trgb[i] += w;\n\t}\n\treturn rgb;\n}\nfunction rgb2hsl(v) {\n\tconst range = 255;\n\tconst r = v.r / range;\n\tconst g = v.g / range;\n\tconst b = v.b / range;\n\tconst max = Math.max(r, g, b);\n\tconst min = Math.min(r, g, b);\n\tconst l = (max + min) / 2;\n\tlet h, s, d;\n\tif (max !== min) {\n\t\td = max - min;\n\t\ts = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\t\th = max === r\n\t\t\t? ((g - b) / d) + (g < b ? 6 : 0)\n\t\t\t: max === g\n\t\t\t\t? (b - r) / d + 2\n\t\t\t\t: (r - g) / d + 4;\n\t\th = h * 60 + 0.5;\n\t}\n\treturn [h | 0, s || 0, l];\n}\nfunction calln(f, a, b, c) {\n\treturn (\n\t\tArray.isArray(a)\n\t\t\t? f(a[0], a[1], a[2])\n\t\t\t: f(a, b, c)\n\t).map(n2b);\n}\nfunction hsl2rgb(h, s, l) {\n\treturn calln(hsl2rgbn, h, s, l);\n}\nfunction hwb2rgb(h, w, b) {\n\treturn calln(hwb2rgbn, h, w, b);\n}\nfunction hsv2rgb(h, s, v) {\n\treturn calln(hsv2rgbn, h, s, v);\n}\nfunction hue(h) {\n\treturn (h % 360 + 360) % 360;\n}\nfunction hueParse(str) {\n\tconst m = HUE_RE.exec(str);\n\tlet a = 255;\n\tlet v;\n\tif (!m) {\n\t\treturn;\n\t}\n\tif (m[5] !== v) {\n\t\ta = m[6] ? p2b(+m[5]) : n2b(+m[5]);\n\t}\n\tconst h = hue(+m[2]);\n\tconst p1 = +m[3] / 100;\n\tconst p2 = +m[4] / 100;\n\tif (m[1] === 'hwb') {\n\t\tv = hwb2rgb(h, p1, p2);\n\t} else if (m[1] === 'hsv') {\n\t\tv = hsv2rgb(h, p1, p2);\n\t} else {\n\t\tv = hsl2rgb(h, p1, p2);\n\t}\n\treturn {\n\t\tr: v[0],\n\t\tg: v[1],\n\t\tb: v[2],\n\t\ta: a\n\t};\n}\nfunction rotate(v, deg) {\n\tvar h = rgb2hsl(v);\n\th[0] = hue(h[0] + deg);\n\th = hsl2rgb(h);\n\tv.r = h[0];\n\tv.g = h[1];\n\tv.b = h[2];\n}\nfunction hslString(v) {\n\tif (!v) {\n\t\treturn;\n\t}\n\tconst a = rgb2hsl(v);\n\tconst h = a[0];\n\tconst s = n2p(a[1]);\n\tconst l = n2p(a[2]);\n\treturn v.a < 255\n\t\t? `hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`\n\t\t: `hsl(${h}, ${s}%, ${l}%)`;\n}\nconst map$1 = {\n\tx: 'dark',\n\tZ: 'light',\n\tY: 're',\n\tX: 'blu',\n\tW: 'gr',\n\tV: 'medium',\n\tU: 'slate',\n\tA: 'ee',\n\tT: 'ol',\n\tS: 'or',\n\tB: 'ra',\n\tC: 'lateg',\n\tD: 'ights',\n\tR: 'in',\n\tQ: 'turquois',\n\tE: 'hi',\n\tP: 'ro',\n\tO: 'al',\n\tN: 'le',\n\tM: 'de',\n\tL: 'yello',\n\tF: 'en',\n\tK: 'ch',\n\tG: 'arks',\n\tH: 'ea',\n\tI: 'ightg',\n\tJ: 'wh'\n};\nconst names = {\n\tOiceXe: 'f0f8ff',\n\tantiquewEte: 'faebd7',\n\taqua: 'ffff',\n\taquamarRe: '7fffd4',\n\tazuY: 'f0ffff',\n\tbeige: 'f5f5dc',\n\tbisque: 'ffe4c4',\n\tblack: '0',\n\tblanKedOmond: 'ffebcd',\n\tXe: 'ff',\n\tXeviTet: '8a2be2',\n\tbPwn: 'a52a2a',\n\tburlywood: 'deb887',\n\tcaMtXe: '5f9ea0',\n\tKartYuse: '7fff00',\n\tKocTate: 'd2691e',\n\tcSO: 'ff7f50',\n\tcSnflowerXe: '6495ed',\n\tcSnsilk: 'fff8dc',\n\tcrimson: 'dc143c',\n\tcyan: 'ffff',\n\txXe: '8b',\n\txcyan: '8b8b',\n\txgTMnPd: 'b8860b',\n\txWay: 'a9a9a9',\n\txgYF: '6400',\n\txgYy: 'a9a9a9',\n\txkhaki: 'bdb76b',\n\txmagFta: '8b008b',\n\txTivegYF: '556b2f',\n\txSange: 'ff8c00',\n\txScEd: '9932cc',\n\txYd: '8b0000',\n\txsOmon: 'e9967a',\n\txsHgYF: '8fbc8f',\n\txUXe: '483d8b',\n\txUWay: '2f4f4f',\n\txUgYy: '2f4f4f',\n\txQe: 'ced1',\n\txviTet: '9400d3',\n\tdAppRk: 'ff1493',\n\tdApskyXe: 'bfff',\n\tdimWay: '696969',\n\tdimgYy: '696969',\n\tdodgerXe: '1e90ff',\n\tfiYbrick: 'b22222',\n\tflSOwEte: 'fffaf0',\n\tfoYstWAn: '228b22',\n\tfuKsia: 'ff00ff',\n\tgaRsbSo: 'dcdcdc',\n\tghostwEte: 'f8f8ff',\n\tgTd: 'ffd700',\n\tgTMnPd: 'daa520',\n\tWay: '808080',\n\tgYF: '8000',\n\tgYFLw: 'adff2f',\n\tgYy: '808080',\n\thoneyMw: 'f0fff0',\n\thotpRk: 'ff69b4',\n\tRdianYd: 'cd5c5c',\n\tRdigo: '4b0082',\n\tivSy: 'fffff0',\n\tkhaki: 'f0e68c',\n\tlavFMr: 'e6e6fa',\n\tlavFMrXsh: 'fff0f5',\n\tlawngYF: '7cfc00',\n\tNmoncEffon: 'fffacd',\n\tZXe: 'add8e6',\n\tZcSO: 'f08080',\n\tZcyan: 'e0ffff',\n\tZgTMnPdLw: 'fafad2',\n\tZWay: 'd3d3d3',\n\tZgYF: '90ee90',\n\tZgYy: 'd3d3d3',\n\tZpRk: 'ffb6c1',\n\tZsOmon: 'ffa07a',\n\tZsHgYF: '20b2aa',\n\tZskyXe: '87cefa',\n\tZUWay: '778899',\n\tZUgYy: '778899',\n\tZstAlXe: 'b0c4de',\n\tZLw: 'ffffe0',\n\tlime: 'ff00',\n\tlimegYF: '32cd32',\n\tlRF: 'faf0e6',\n\tmagFta: 'ff00ff',\n\tmaPon: '800000',\n\tVaquamarRe: '66cdaa',\n\tVXe: 'cd',\n\tVScEd: 'ba55d3',\n\tVpurpN: '9370db',\n\tVsHgYF: '3cb371',\n\tVUXe: '7b68ee',\n\tVsprRggYF: 'fa9a',\n\tVQe: '48d1cc',\n\tVviTetYd: 'c71585',\n\tmidnightXe: '191970',\n\tmRtcYam: 'f5fffa',\n\tmistyPse: 'ffe4e1',\n\tmoccasR: 'ffe4b5',\n\tnavajowEte: 'ffdead',\n\tnavy: '80',\n\tTdlace: 'fdf5e6',\n\tTive: '808000',\n\tTivedBb: '6b8e23',\n\tSange: 'ffa500',\n\tSangeYd: 'ff4500',\n\tScEd: 'da70d6',\n\tpOegTMnPd: 'eee8aa',\n\tpOegYF: '98fb98',\n\tpOeQe: 'afeeee',\n\tpOeviTetYd: 'db7093',\n\tpapayawEp: 'ffefd5',\n\tpHKpuff: 'ffdab9',\n\tperu: 'cd853f',\n\tpRk: 'ffc0cb',\n\tplum: 'dda0dd',\n\tpowMrXe: 'b0e0e6',\n\tpurpN: '800080',\n\tYbeccapurpN: '663399',\n\tYd: 'ff0000',\n\tPsybrown: 'bc8f8f',\n\tPyOXe: '4169e1',\n\tsaddNbPwn: '8b4513',\n\tsOmon: 'fa8072',\n\tsandybPwn: 'f4a460',\n\tsHgYF: '2e8b57',\n\tsHshell: 'fff5ee',\n\tsiFna: 'a0522d',\n\tsilver: 'c0c0c0',\n\tskyXe: '87ceeb',\n\tUXe: '6a5acd',\n\tUWay: '708090',\n\tUgYy: '708090',\n\tsnow: 'fffafa',\n\tsprRggYF: 'ff7f',\n\tstAlXe: '4682b4',\n\ttan: 'd2b48c',\n\tteO: '8080',\n\ttEstN: 'd8bfd8',\n\ttomato: 'ff6347',\n\tQe: '40e0d0',\n\tviTet: 'ee82ee',\n\tJHt: 'f5deb3',\n\twEte: 'ffffff',\n\twEtesmoke: 'f5f5f5',\n\tLw: 'ffff00',\n\tLwgYF: '9acd32'\n};\nfunction unpack() {\n\tconst unpacked = {};\n\tconst keys = Object.keys(names);\n\tconst tkeys = Object.keys(map$1);\n\tlet i, j, k, ok, nk;\n\tfor (i = 0; i < keys.length; i++) {\n\t\tok = nk = keys[i];\n\t\tfor (j = 0; j < tkeys.length; j++) {\n\t\t\tk = tkeys[j];\n\t\t\tnk = nk.replace(k, map$1[k]);\n\t\t}\n\t\tk = parseInt(names[ok], 16);\n\t\tunpacked[nk] = [k >> 16 & 0xFF, k >> 8 & 0xFF, k & 0xFF];\n\t}\n\treturn unpacked;\n}\nlet names$1;\nfunction nameParse(str) {\n\tif (!names$1) {\n\t\tnames$1 = unpack();\n\t\tnames$1.transparent = [0, 0, 0, 0];\n\t}\n\tconst a = names$1[str.toLowerCase()];\n\treturn a && {\n\t\tr: a[0],\n\t\tg: a[1],\n\t\tb: a[2],\n\t\ta: a.length === 4 ? a[3] : 255\n\t};\n}\nfunction modHSL(v, i, ratio) {\n\tif (v) {\n\t\tlet tmp = rgb2hsl(v);\n\t\ttmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));\n\t\ttmp = hsl2rgb(tmp);\n\t\tv.r = tmp[0];\n\t\tv.g = tmp[1];\n\t\tv.b = tmp[2];\n\t}\n}\nfunction clone(v, proto) {\n\treturn v ? Object.assign(proto || {}, v) : v;\n}\nfunction fromObject(input) {\n\tvar v = {r: 0, g: 0, b: 0, a: 255};\n\tif (Array.isArray(input)) {\n\t\tif (input.length >= 3) {\n\t\t\tv = {r: input[0], g: input[1], b: input[2], a: 255};\n\t\t\tif (input.length > 3) {\n\t\t\t\tv.a = n2b(input[3]);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tv = clone(input, {r: 0, g: 0, b: 0, a: 1});\n\t\tv.a = n2b(v.a);\n\t}\n\treturn v;\n}\nfunction functionParse(str) {\n\tif (str.charAt(0) === 'r') {\n\t\treturn rgbParse(str);\n\t}\n\treturn hueParse(str);\n}\nclass Color {\n\tconstructor(input) {\n\t\tif (input instanceof Color) {\n\t\t\treturn input;\n\t\t}\n\t\tconst type = typeof input;\n\t\tlet v;\n\t\tif (type === 'object') {\n\t\t\tv = fromObject(input);\n\t\t} else if (type === 'string') {\n\t\t\tv = hexParse(input) || nameParse(input) || functionParse(input);\n\t\t}\n\t\tthis._rgb = v;\n\t\tthis._valid = !!v;\n\t}\n\tget valid() {\n\t\treturn this._valid;\n\t}\n\tget rgb() {\n\t\tvar v = clone(this._rgb);\n\t\tif (v) {\n\t\t\tv.a = b2n(v.a);\n\t\t}\n\t\treturn v;\n\t}\n\tset rgb(obj) {\n\t\tthis._rgb = fromObject(obj);\n\t}\n\trgbString() {\n\t\treturn this._valid ? rgbString(this._rgb) : this._rgb;\n\t}\n\thexString() {\n\t\treturn this._valid ? hexString(this._rgb) : this._rgb;\n\t}\n\thslString() {\n\t\treturn this._valid ? hslString(this._rgb) : this._rgb;\n\t}\n\tmix(color, weight) {\n\t\tconst me = this;\n\t\tif (color) {\n\t\t\tconst c1 = me.rgb;\n\t\t\tconst c2 = color.rgb;\n\t\t\tlet w2;\n\t\t\tconst p = weight === w2 ? 0.5 : weight;\n\t\t\tconst w = 2 * p - 1;\n\t\t\tconst a = c1.a - c2.a;\n\t\t\tconst w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n\t\t\tw2 = 1 - w1;\n\t\t\tc1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;\n\t\t\tc1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;\n\t\t\tc1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;\n\t\t\tc1.a = p * c1.a + (1 - p) * c2.a;\n\t\t\tme.rgb = c1;\n\t\t}\n\t\treturn me;\n\t}\n\tclone() {\n\t\treturn new Color(this.rgb);\n\t}\n\talpha(a) {\n\t\tthis._rgb.a = n2b(a);\n\t\treturn this;\n\t}\n\tclearer(ratio) {\n\t\tconst rgb = this._rgb;\n\t\trgb.a *= 1 - ratio;\n\t\treturn this;\n\t}\n\tgreyscale() {\n\t\tconst rgb = this._rgb;\n\t\tconst val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);\n\t\trgb.r = rgb.g = rgb.b = val;\n\t\treturn this;\n\t}\n\topaquer(ratio) {\n\t\tconst rgb = this._rgb;\n\t\trgb.a *= 1 + ratio;\n\t\treturn this;\n\t}\n\tnegate() {\n\t\tconst v = this._rgb;\n\t\tv.r = 255 - v.r;\n\t\tv.g = 255 - v.g;\n\t\tv.b = 255 - v.b;\n\t\treturn this;\n\t}\n\tlighten(ratio) {\n\t\tmodHSL(this._rgb, 2, ratio);\n\t\treturn this;\n\t}\n\tdarken(ratio) {\n\t\tmodHSL(this._rgb, 2, -ratio);\n\t\treturn this;\n\t}\n\tsaturate(ratio) {\n\t\tmodHSL(this._rgb, 1, ratio);\n\t\treturn this;\n\t}\n\tdesaturate(ratio) {\n\t\tmodHSL(this._rgb, 1, -ratio);\n\t\treturn this;\n\t}\n\trotate(deg) {\n\t\trotate(this._rgb, deg);\n\t\treturn this;\n\t}\n}\nfunction index_esm(input) {\n\treturn new Color(input);\n}\n\nconst isPatternOrGradient = (value) => value instanceof CanvasGradient || value instanceof CanvasPattern;\nfunction color(value) {\n return isPatternOrGradient(value) ? value : index_esm(value);\n}\nfunction getHoverColor(value) {\n return isPatternOrGradient(value)\n ? value\n : index_esm(value).saturate(0.5).darken(0.1).hexString();\n}\n\nconst overrides = Object.create(null);\nconst descriptors = Object.create(null);\nfunction getScope$1(node, key) {\n if (!key) {\n return node;\n }\n const keys = key.split('.');\n for (let i = 0, n = keys.length; i < n; ++i) {\n const k = keys[i];\n node = node[k] || (node[k] = Object.create(null));\n }\n return node;\n}\nfunction set(root, scope, values) {\n if (typeof scope === 'string') {\n return merge(getScope$1(root, scope), values);\n }\n return merge(getScope$1(root, ''), scope);\n}\nclass Defaults {\n constructor(_descriptors) {\n this.animation = undefined;\n this.backgroundColor = 'rgba(0,0,0,0.1)';\n this.borderColor = 'rgba(0,0,0,0.1)';\n this.color = '#666';\n this.datasets = {};\n this.devicePixelRatio = (context) => context.chart.platform.getDevicePixelRatio();\n this.elements = {};\n this.events = [\n 'mousemove',\n 'mouseout',\n 'click',\n 'touchstart',\n 'touchmove'\n ];\n this.font = {\n family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n size: 12,\n style: 'normal',\n lineHeight: 1.2,\n weight: null\n };\n this.hover = {};\n this.hoverBackgroundColor = (ctx, options) => getHoverColor(options.backgroundColor);\n this.hoverBorderColor = (ctx, options) => getHoverColor(options.borderColor);\n this.hoverColor = (ctx, options) => getHoverColor(options.color);\n this.indexAxis = 'x';\n this.interaction = {\n mode: 'nearest',\n intersect: true\n };\n this.maintainAspectRatio = true;\n this.onHover = null;\n this.onClick = null;\n this.parsing = true;\n this.plugins = {};\n this.responsive = true;\n this.scale = undefined;\n this.scales = {};\n this.showLine = true;\n this.drawActiveElementsOnTop = true;\n this.describe(_descriptors);\n }\n set(scope, values) {\n return set(this, scope, values);\n }\n get(scope) {\n return getScope$1(this, scope);\n }\n describe(scope, values) {\n return set(descriptors, scope, values);\n }\n override(scope, values) {\n return set(overrides, scope, values);\n }\n route(scope, name, targetScope, targetName) {\n const scopeObject = getScope$1(this, scope);\n const targetScopeObject = getScope$1(this, targetScope);\n const privateName = '_' + name;\n Object.defineProperties(scopeObject, {\n [privateName]: {\n value: scopeObject[name],\n writable: true\n },\n [name]: {\n enumerable: true,\n get() {\n const local = this[privateName];\n const target = targetScopeObject[targetName];\n if (isObject(local)) {\n return Object.assign({}, target, local);\n }\n return valueOrDefault(local, target);\n },\n set(value) {\n this[privateName] = value;\n }\n }\n });\n }\n}\nvar defaults = new Defaults({\n _scriptable: (name) => !name.startsWith('on'),\n _indexable: (name) => name !== 'events',\n hover: {\n _fallback: 'interaction'\n },\n interaction: {\n _scriptable: false,\n _indexable: false,\n }\n});\n\nfunction toFontString(font) {\n if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n return null;\n }\n return (font.style ? font.style + ' ' : '')\n\t\t+ (font.weight ? font.weight + ' ' : '')\n\t\t+ font.size + 'px '\n\t\t+ font.family;\n}\nfunction _measureText(ctx, data, gc, longest, string) {\n let textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n}\nfunction _longestText(ctx, font, arrayOfThings, cache) {\n cache = cache || {};\n let data = cache.data = cache.data || {};\n let gc = cache.garbageCollect = cache.garbageCollect || [];\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n ctx.save();\n ctx.font = font;\n let longest = 0;\n const ilen = arrayOfThings.length;\n let i, j, jlen, thing, nestedThing;\n for (i = 0; i < ilen; i++) {\n thing = arrayOfThings[i];\n if (thing !== undefined && thing !== null && isArray(thing) !== true) {\n longest = _measureText(ctx, data, gc, longest, thing);\n } else if (isArray(thing)) {\n for (j = 0, jlen = thing.length; j < jlen; j++) {\n nestedThing = thing[j];\n if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n longest = _measureText(ctx, data, gc, longest, nestedThing);\n }\n }\n }\n }\n ctx.restore();\n const gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for (i = 0; i < gcLen; i++) {\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n}\nfunction _alignPixel(chart, pixel, width) {\n const devicePixelRatio = chart.currentDevicePixelRatio;\n const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\nfunction clearCanvas(canvas, ctx) {\n ctx = ctx || canvas.getContext('2d');\n ctx.save();\n ctx.resetTransform();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.restore();\n}\nfunction drawPoint(ctx, options, x, y) {\n let type, xOffset, yOffset, size, cornerRadius;\n const style = options.pointStyle;\n const rotation = options.rotation;\n const radius = options.radius;\n let rad = (rotation || 0) * RAD_PER_DEG;\n if (style && typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.save();\n ctx.translate(x, y);\n ctx.rotate(rad);\n ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n ctx.restore();\n return;\n }\n }\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n ctx.beginPath();\n switch (style) {\n default:\n ctx.arc(x, y, radius, 0, TAU);\n ctx.closePath();\n break;\n case 'triangle':\n ctx.moveTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\n rad += TWO_THIRDS_PI;\n ctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\n ctx.closePath();\n break;\n case 'rectRounded':\n cornerRadius = radius * 0.516;\n size = radius - cornerRadius;\n xOffset = Math.cos(rad + QUARTER_PI) * size;\n yOffset = Math.sin(rad + QUARTER_PI) * size;\n ctx.arc(x - xOffset, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n ctx.arc(x + yOffset, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n ctx.arc(x + xOffset, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n ctx.arc(x - yOffset, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n ctx.closePath();\n break;\n case 'rect':\n if (!rotation) {\n size = Math.SQRT1_2 * radius;\n ctx.rect(x - size, y - size, 2 * size, 2 * size);\n break;\n }\n rad += QUARTER_PI;\n case 'rectRot':\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + yOffset, y - xOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n ctx.lineTo(x - yOffset, y + xOffset);\n ctx.closePath();\n break;\n case 'crossRot':\n rad += QUARTER_PI;\n case 'cross':\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n ctx.moveTo(x + yOffset, y - xOffset);\n ctx.lineTo(x - yOffset, y + xOffset);\n break;\n case 'star':\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n ctx.moveTo(x + yOffset, y - xOffset);\n ctx.lineTo(x - yOffset, y + xOffset);\n rad += QUARTER_PI;\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n ctx.moveTo(x + yOffset, y - xOffset);\n ctx.lineTo(x - yOffset, y + xOffset);\n break;\n case 'line':\n xOffset = Math.cos(rad) * radius;\n yOffset = Math.sin(rad) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n break;\n case 'dash':\n ctx.moveTo(x, y);\n ctx.lineTo(x + Math.cos(rad) * radius, y + Math.sin(rad) * radius);\n break;\n }\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n}\nfunction _isPointInArea(point, area, margin) {\n margin = margin || 0.5;\n return !area || (point && point.x > area.left - margin && point.x < area.right + margin &&\n\t\tpoint.y > area.top - margin && point.y < area.bottom + margin);\n}\nfunction clipArea(ctx, area) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n}\nfunction unclipArea(ctx) {\n ctx.restore();\n}\nfunction _steppedLineTo(ctx, previous, target, flip, mode) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n if (mode === 'middle') {\n const midpoint = (previous.x + target.x) / 2.0;\n ctx.lineTo(midpoint, previous.y);\n ctx.lineTo(midpoint, target.y);\n } else if (mode === 'after' !== !!flip) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n}\nfunction _bezierCurveTo(ctx, previous, target, flip) {\n if (!previous) {\n return ctx.lineTo(target.x, target.y);\n }\n ctx.bezierCurveTo(\n flip ? previous.cp1x : previous.cp2x,\n flip ? previous.cp1y : previous.cp2y,\n flip ? target.cp2x : target.cp1x,\n flip ? target.cp2y : target.cp1y,\n target.x,\n target.y);\n}\nfunction renderText(ctx, text, x, y, font, opts = {}) {\n const lines = isArray(text) ? text : [text];\n const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n let i, line;\n ctx.save();\n ctx.font = font.string;\n setRenderOpts(ctx, opts);\n for (i = 0; i < lines.length; ++i) {\n line = lines[i];\n if (stroke) {\n if (opts.strokeColor) {\n ctx.strokeStyle = opts.strokeColor;\n }\n if (!isNullOrUndef(opts.strokeWidth)) {\n ctx.lineWidth = opts.strokeWidth;\n }\n ctx.strokeText(line, x, y, opts.maxWidth);\n }\n ctx.fillText(line, x, y, opts.maxWidth);\n decorateText(ctx, x, y, line, opts);\n y += font.lineHeight;\n }\n ctx.restore();\n}\nfunction setRenderOpts(ctx, opts) {\n if (opts.translation) {\n ctx.translate(opts.translation[0], opts.translation[1]);\n }\n if (!isNullOrUndef(opts.rotation)) {\n ctx.rotate(opts.rotation);\n }\n if (opts.color) {\n ctx.fillStyle = opts.color;\n }\n if (opts.textAlign) {\n ctx.textAlign = opts.textAlign;\n }\n if (opts.textBaseline) {\n ctx.textBaseline = opts.textBaseline;\n }\n}\nfunction decorateText(ctx, x, y, line, opts) {\n if (opts.strikethrough || opts.underline) {\n const metrics = ctx.measureText(line);\n const left = x - metrics.actualBoundingBoxLeft;\n const right = x + metrics.actualBoundingBoxRight;\n const top = y - metrics.actualBoundingBoxAscent;\n const bottom = y + metrics.actualBoundingBoxDescent;\n const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n ctx.strokeStyle = ctx.fillStyle;\n ctx.beginPath();\n ctx.lineWidth = opts.decorationWidth || 2;\n ctx.moveTo(left, yDecoration);\n ctx.lineTo(right, yDecoration);\n ctx.stroke();\n }\n}\nfunction addRoundedRectPath(ctx, rect) {\n const {x, y, w, h, radius} = rect;\n ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, -HALF_PI, PI, true);\n ctx.lineTo(x, y + h - radius.bottomLeft);\n ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n ctx.lineTo(x + w - radius.bottomRight, y + h);\n ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n ctx.lineTo(x + w, y + radius.topRight);\n ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n ctx.lineTo(x + radius.topLeft, y);\n}\n\nconst LINE_HEIGHT = new RegExp(/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/);\nconst FONT_STYLE = new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);\nfunction toLineHeight(value, size) {\n const matches = ('' + value).match(LINE_HEIGHT);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n value = +matches[2];\n switch (matches[3]) {\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n }\n return size * value;\n}\nconst numberOrZero = v => +v || 0;\nfunction _readValueToProps(value, props) {\n const ret = {};\n const objProps = isObject(props);\n const keys = objProps ? Object.keys(props) : props;\n const read = isObject(value)\n ? objProps\n ? prop => valueOrDefault(value[prop], value[props[prop]])\n : prop => value[prop]\n : () => value;\n for (const prop of keys) {\n ret[prop] = numberOrZero(read(prop));\n }\n return ret;\n}\nfunction toTRBL(value) {\n return _readValueToProps(value, {top: 'y', right: 'x', bottom: 'y', left: 'x'});\n}\nfunction toTRBLCorners(value) {\n return _readValueToProps(value, ['topLeft', 'topRight', 'bottomLeft', 'bottomRight']);\n}\nfunction toPadding(value) {\n const obj = toTRBL(value);\n obj.width = obj.left + obj.right;\n obj.height = obj.top + obj.bottom;\n return obj;\n}\nfunction toFont(options, fallback) {\n options = options || {};\n fallback = fallback || defaults.font;\n let size = valueOrDefault(options.size, fallback.size);\n if (typeof size === 'string') {\n size = parseInt(size, 10);\n }\n let style = valueOrDefault(options.style, fallback.style);\n if (style && !('' + style).match(FONT_STYLE)) {\n console.warn('Invalid font style specified: \"' + style + '\"');\n style = '';\n }\n const font = {\n family: valueOrDefault(options.family, fallback.family),\n lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n size,\n style,\n weight: valueOrDefault(options.weight, fallback.weight),\n string: ''\n };\n font.string = toFontString(font);\n return font;\n}\nfunction resolve(inputs, context, index, info) {\n let cacheable = true;\n let i, ilen, value;\n for (i = 0, ilen = inputs.length; i < ilen; ++i) {\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n cacheable = false;\n }\n if (index !== undefined && isArray(value)) {\n value = value[index % value.length];\n cacheable = false;\n }\n if (value !== undefined) {\n if (info && !cacheable) {\n info.cacheable = false;\n }\n return value;\n }\n }\n}\nfunction _addGrace(minmax, grace, beginAtZero) {\n const {min, max} = minmax;\n const change = toDimension(grace, (max - min) / 2);\n const keepZero = (value, add) => beginAtZero && value === 0 ? 0 : value + add;\n return {\n min: keepZero(min, -Math.abs(change)),\n max: keepZero(max, change)\n };\n}\nfunction createContext(parentContext, context) {\n return Object.assign(Object.create(parentContext), context);\n}\n\nfunction _lookup(table, value, cmp) {\n cmp = cmp || ((index) => table[index] < value);\n let hi = table.length - 1;\n let lo = 0;\n let mid;\n while (hi - lo > 1) {\n mid = (lo + hi) >> 1;\n if (cmp(mid)) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return {lo, hi};\n}\nconst _lookupByKey = (table, key, value) =>\n _lookup(table, value, index => table[index][key] < value);\nconst _rlookupByKey = (table, key, value) =>\n _lookup(table, value, index => table[index][key] >= value);\nfunction _filterBetween(values, min, max) {\n let start = 0;\n let end = values.length;\n while (start < end && values[start] < min) {\n start++;\n }\n while (end > start && values[end - 1] > max) {\n end--;\n }\n return start > 0 || end < values.length\n ? values.slice(start, end)\n : values;\n}\nconst arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'];\nfunction listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [listener]\n }\n });\n arrayEvents.forEach((key) => {\n const method = '_onData' + _capitalize(key);\n const base = array[key];\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value(...args) {\n const res = base.apply(this, args);\n array._chartjs.listeners.forEach((object) => {\n if (typeof object[method] === 'function') {\n object[method](...args);\n }\n });\n return res;\n }\n });\n });\n}\nfunction unlistenArrayEvents(array, listener) {\n const stub = array._chartjs;\n if (!stub) {\n return;\n }\n const listeners = stub.listeners;\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n if (listeners.length > 0) {\n return;\n }\n arrayEvents.forEach((key) => {\n delete array[key];\n });\n delete array._chartjs;\n}\nfunction _arrayUnique(items) {\n const set = new Set();\n let i, ilen;\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n set.add(items[i]);\n }\n if (set.size === ilen) {\n return items;\n }\n return Array.from(set);\n}\n\nfunction _createResolver(scopes, prefixes = [''], rootScopes = scopes, fallback, getTarget = () => scopes[0]) {\n if (!defined(fallback)) {\n fallback = _resolve('_fallback', scopes);\n }\n const cache = {\n [Symbol.toStringTag]: 'Object',\n _cacheable: true,\n _scopes: scopes,\n _rootScopes: rootScopes,\n _fallback: fallback,\n _getTarget: getTarget,\n override: (scope) => _createResolver([scope, ...scopes], prefixes, rootScopes, fallback),\n };\n return new Proxy(cache, {\n deleteProperty(target, prop) {\n delete target[prop];\n delete target._keys;\n delete scopes[0][prop];\n return true;\n },\n get(target, prop) {\n return _cached(target, prop,\n () => _resolveWithPrefixes(prop, prefixes, scopes, target));\n },\n getOwnPropertyDescriptor(target, prop) {\n return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n },\n getPrototypeOf() {\n return Reflect.getPrototypeOf(scopes[0]);\n },\n has(target, prop) {\n return getKeysFromAllScopes(target).includes(prop);\n },\n ownKeys(target) {\n return getKeysFromAllScopes(target);\n },\n set(target, prop, value) {\n const storage = target._storage || (target._storage = getTarget());\n target[prop] = storage[prop] = value;\n delete target._keys;\n return true;\n }\n });\n}\nfunction _attachContext(proxy, context, subProxy, descriptorDefaults) {\n const cache = {\n _cacheable: false,\n _proxy: proxy,\n _context: context,\n _subProxy: subProxy,\n _stack: new Set(),\n _descriptors: _descriptors(proxy, descriptorDefaults),\n setContext: (ctx) => _attachContext(proxy, ctx, subProxy, descriptorDefaults),\n override: (scope) => _attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n };\n return new Proxy(cache, {\n deleteProperty(target, prop) {\n delete target[prop];\n delete proxy[prop];\n return true;\n },\n get(target, prop, receiver) {\n return _cached(target, prop,\n () => _resolveWithContext(target, prop, receiver));\n },\n getOwnPropertyDescriptor(target, prop) {\n return target._descriptors.allKeys\n ? Reflect.has(proxy, prop) ? {enumerable: true, configurable: true} : undefined\n : Reflect.getOwnPropertyDescriptor(proxy, prop);\n },\n getPrototypeOf() {\n return Reflect.getPrototypeOf(proxy);\n },\n has(target, prop) {\n return Reflect.has(proxy, prop);\n },\n ownKeys() {\n return Reflect.ownKeys(proxy);\n },\n set(target, prop, value) {\n proxy[prop] = value;\n delete target[prop];\n return true;\n }\n });\n}\nfunction _descriptors(proxy, defaults = {scriptable: true, indexable: true}) {\n const {_scriptable = defaults.scriptable, _indexable = defaults.indexable, _allKeys = defaults.allKeys} = proxy;\n return {\n allKeys: _allKeys,\n scriptable: _scriptable,\n indexable: _indexable,\n isScriptable: isFunction(_scriptable) ? _scriptable : () => _scriptable,\n isIndexable: isFunction(_indexable) ? _indexable : () => _indexable\n };\n}\nconst readKey = (prefix, name) => prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop, value) => isObject(value) && prop !== 'adapters' &&\n (Object.getPrototypeOf(value) === null || value.constructor === Object);\nfunction _cached(target, prop, resolve) {\n if (Object.prototype.hasOwnProperty.call(target, prop)) {\n return target[prop];\n }\n const value = resolve();\n target[prop] = value;\n return value;\n}\nfunction _resolveWithContext(target, prop, receiver) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n let value = _proxy[prop];\n if (isFunction(value) && descriptors.isScriptable(prop)) {\n value = _resolveScriptable(prop, value, target, receiver);\n }\n if (isArray(value) && value.length) {\n value = _resolveArray(prop, value, target, descriptors.isIndexable);\n }\n if (needsSubResolver(prop, value)) {\n value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n }\n return value;\n}\nfunction _resolveScriptable(prop, value, target, receiver) {\n const {_proxy, _context, _subProxy, _stack} = target;\n if (_stack.has(prop)) {\n throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n }\n _stack.add(prop);\n value = value(_context, _subProxy || receiver);\n _stack.delete(prop);\n if (needsSubResolver(prop, value)) {\n value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n }\n return value;\n}\nfunction _resolveArray(prop, value, target, isIndexable) {\n const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n if (defined(_context.index) && isIndexable(prop)) {\n value = value[_context.index % value.length];\n } else if (isObject(value[0])) {\n const arr = value;\n const scopes = _proxy._scopes.filter(s => s !== arr);\n value = [];\n for (const item of arr) {\n const resolver = createSubResolver(scopes, _proxy, prop, item);\n value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n }\n }\n return value;\n}\nfunction resolveFallback(fallback, prop, value) {\n return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\nconst getScope = (key, parent) => key === true ? parent\n : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\nfunction addScopes(set, parentScopes, key, parentFallback, value) {\n for (const parent of parentScopes) {\n const scope = getScope(key, parent);\n if (scope) {\n set.add(scope);\n const fallback = resolveFallback(scope._fallback, key, value);\n if (defined(fallback) && fallback !== key && fallback !== parentFallback) {\n return fallback;\n }\n } else if (scope === false && defined(parentFallback) && key !== parentFallback) {\n return null;\n }\n }\n return false;\n}\nfunction createSubResolver(parentScopes, resolver, prop, value) {\n const rootScopes = resolver._rootScopes;\n const fallback = resolveFallback(resolver._fallback, prop, value);\n const allScopes = [...parentScopes, ...rootScopes];\n const set = new Set();\n set.add(value);\n let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n if (key === null) {\n return false;\n }\n if (defined(fallback) && fallback !== prop) {\n key = addScopesFromKey(set, allScopes, fallback, key, value);\n if (key === null) {\n return false;\n }\n }\n return _createResolver(Array.from(set), [''], rootScopes, fallback,\n () => subGetTarget(resolver, prop, value));\n}\nfunction addScopesFromKey(set, allScopes, key, fallback, item) {\n while (key) {\n key = addScopes(set, allScopes, key, fallback, item);\n }\n return key;\n}\nfunction subGetTarget(resolver, prop, value) {\n const parent = resolver._getTarget();\n if (!(prop in parent)) {\n parent[prop] = {};\n }\n const target = parent[prop];\n if (isArray(target) && isObject(value)) {\n return value;\n }\n return target;\n}\nfunction _resolveWithPrefixes(prop, prefixes, scopes, proxy) {\n let value;\n for (const prefix of prefixes) {\n value = _resolve(readKey(prefix, prop), scopes);\n if (defined(value)) {\n return needsSubResolver(prop, value)\n ? createSubResolver(scopes, proxy, prop, value)\n : value;\n }\n }\n}\nfunction _resolve(key, scopes) {\n for (const scope of scopes) {\n if (!scope) {\n continue;\n }\n const value = scope[key];\n if (defined(value)) {\n return value;\n }\n }\n}\nfunction getKeysFromAllScopes(target) {\n let keys = target._keys;\n if (!keys) {\n keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n }\n return keys;\n}\nfunction resolveKeysFromAllScopes(scopes) {\n const set = new Set();\n for (const scope of scopes) {\n for (const key of Object.keys(scope).filter(k => !k.startsWith('_'))) {\n set.add(key);\n }\n }\n return Array.from(set);\n}\n\nconst EPSILON = Number.EPSILON || 1e-14;\nconst getPoint = (points, i) => i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis) => indexAxis === 'x' ? 'y' : 'x';\nfunction splineCurve(firstPoint, middlePoint, afterPoint, t) {\n const previous = firstPoint.skip ? middlePoint : firstPoint;\n const current = middlePoint;\n const next = afterPoint.skip ? middlePoint : afterPoint;\n const d01 = distanceBetweenPoints(current, previous);\n const d12 = distanceBetweenPoints(next, current);\n let s01 = d01 / (d01 + d12);\n let s12 = d12 / (d01 + d12);\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n const fa = t * s01;\n const fb = t * s12;\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n}\nfunction monotoneAdjust(points, deltaK, mK) {\n const pointsLen = points.length;\n let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for (let i = 0; i < pointsLen - 1; ++i) {\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent || !pointAfter) {\n continue;\n }\n if (almostEquals(deltaK[i], 0, EPSILON)) {\n mK[i] = mK[i + 1] = 0;\n continue;\n }\n alphaK = mK[i] / deltaK[i];\n betaK = mK[i + 1] / deltaK[i];\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n tauK = 3 / Math.sqrt(squaredMagnitude);\n mK[i] = alphaK * tauK * deltaK[i];\n mK[i + 1] = betaK * tauK * deltaK[i];\n }\n}\nfunction monotoneCompute(points, mK, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n let delta, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for (let i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n const iPixel = pointCurrent[indexAxis];\n const vPixel = pointCurrent[valueAxis];\n if (pointBefore) {\n delta = (iPixel - pointBefore[indexAxis]) / 3;\n pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n }\n if (pointAfter) {\n delta = (pointAfter[indexAxis] - iPixel) / 3;\n pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n }\n }\n}\nfunction splineCurveMonotone(points, indexAxis = 'x') {\n const valueAxis = getValueAxis(indexAxis);\n const pointsLen = points.length;\n const deltaK = Array(pointsLen).fill(0);\n const mK = Array(pointsLen);\n let i, pointBefore, pointCurrent;\n let pointAfter = getPoint(points, 0);\n for (i = 0; i < pointsLen; ++i) {\n pointBefore = pointCurrent;\n pointCurrent = pointAfter;\n pointAfter = getPoint(points, i + 1);\n if (!pointCurrent) {\n continue;\n }\n if (pointAfter) {\n const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n }\n mK[i] = !pointBefore ? deltaK[i]\n : !pointAfter ? deltaK[i - 1]\n : (sign(deltaK[i - 1]) !== sign(deltaK[i])) ? 0\n : (deltaK[i - 1] + deltaK[i]) / 2;\n }\n monotoneAdjust(points, deltaK, mK);\n monotoneCompute(points, mK, indexAxis);\n}\nfunction capControlPoint(pt, min, max) {\n return Math.max(Math.min(pt, max), min);\n}\nfunction capBezierPoints(points, area) {\n let i, ilen, point, inArea, inAreaPrev;\n let inAreaNext = _isPointInArea(points[0], area);\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n inAreaPrev = inArea;\n inArea = inAreaNext;\n inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n if (!inArea) {\n continue;\n }\n point = points[i];\n if (inAreaPrev) {\n point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n }\n if (inAreaNext) {\n point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n }\n }\n}\nfunction _updateBezierControlPoints(points, options, area, loop, indexAxis) {\n let i, ilen, point, controlPoints;\n if (options.spanGaps) {\n points = points.filter((pt) => !pt.skip);\n }\n if (options.cubicInterpolationMode === 'monotone') {\n splineCurveMonotone(points, indexAxis);\n } else {\n let prev = loop ? points[points.length - 1] : points[0];\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n point = points[i];\n controlPoints = splineCurve(\n prev,\n point,\n points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen],\n options.tension\n );\n point.cp1x = controlPoints.previous.x;\n point.cp1y = controlPoints.previous.y;\n point.cp2x = controlPoints.next.x;\n point.cp2y = controlPoints.next.y;\n prev = point;\n }\n }\n if (options.capBezierPoints) {\n capBezierPoints(points, area);\n }\n}\n\nfunction _isDomSupported() {\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\nfunction _getParentNode(domNode) {\n let parent = domNode.parentNode;\n if (parent && parent.toString() === '[object ShadowRoot]') {\n parent = parent.host;\n }\n return parent;\n}\nfunction parseMaxStyle(styleValue, node, parentProperty) {\n let valueInPixels;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n if (styleValue.indexOf('%') !== -1) {\n valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n return valueInPixels;\n}\nconst getComputedStyle = (element) => window.getComputedStyle(element, null);\nfunction getStyle(el, property) {\n return getComputedStyle(el).getPropertyValue(property);\n}\nconst positions = ['top', 'right', 'bottom', 'left'];\nfunction getPositionedStyle(styles, style, suffix) {\n const result = {};\n suffix = suffix ? '-' + suffix : '';\n for (let i = 0; i < 4; i++) {\n const pos = positions[i];\n result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n }\n result.width = result.left + result.right;\n result.height = result.top + result.bottom;\n return result;\n}\nconst useOffsetPos = (x, y, target) => (x > 0 || y > 0) && (!target || !target.shadowRoot);\nfunction getCanvasPosition(evt, canvas) {\n const e = evt.native || evt;\n const touches = e.touches;\n const source = touches && touches.length ? touches[0] : e;\n const {offsetX, offsetY} = source;\n let box = false;\n let x, y;\n if (useOffsetPos(offsetX, offsetY, e.target)) {\n x = offsetX;\n y = offsetY;\n } else {\n const rect = canvas.getBoundingClientRect();\n x = source.clientX - rect.left;\n y = source.clientY - rect.top;\n box = true;\n }\n return {x, y, box};\n}\nfunction getRelativePosition(evt, chart) {\n const {canvas, currentDevicePixelRatio} = chart;\n const style = getComputedStyle(canvas);\n const borderBox = style.boxSizing === 'border-box';\n const paddings = getPositionedStyle(style, 'padding');\n const borders = getPositionedStyle(style, 'border', 'width');\n const {x, y, box} = getCanvasPosition(evt, canvas);\n const xOffset = paddings.left + (box && borders.left);\n const yOffset = paddings.top + (box && borders.top);\n let {width, height} = chart;\n if (borderBox) {\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n return {\n x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n };\n}\nfunction getContainerSize(canvas, width, height) {\n let maxWidth, maxHeight;\n if (width === undefined || height === undefined) {\n const container = _getParentNode(canvas);\n if (!container) {\n width = canvas.clientWidth;\n height = canvas.clientHeight;\n } else {\n const rect = container.getBoundingClientRect();\n const containerStyle = getComputedStyle(container);\n const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n const containerPadding = getPositionedStyle(containerStyle, 'padding');\n width = rect.width - containerPadding.width - containerBorder.width;\n height = rect.height - containerPadding.height - containerBorder.height;\n maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n }\n }\n return {\n width,\n height,\n maxWidth: maxWidth || INFINITY,\n maxHeight: maxHeight || INFINITY\n };\n}\nconst round1 = v => Math.round(v * 10) / 10;\nfunction getMaximumSize(canvas, bbWidth, bbHeight, aspectRatio) {\n const style = getComputedStyle(canvas);\n const margins = getPositionedStyle(style, 'margin');\n const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n let {width, height} = containerSize;\n if (style.boxSizing === 'content-box') {\n const borders = getPositionedStyle(style, 'border', 'width');\n const paddings = getPositionedStyle(style, 'padding');\n width -= paddings.width + borders.width;\n height -= paddings.height + borders.height;\n }\n width = Math.max(0, width - margins.width);\n height = Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height - margins.height);\n width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n if (width && !height) {\n height = round1(width / 2);\n }\n return {\n width,\n height\n };\n}\nfunction retinaScale(chart, forceRatio, forceStyle) {\n const pixelRatio = forceRatio || 1;\n const deviceHeight = Math.floor(chart.height * pixelRatio);\n const deviceWidth = Math.floor(chart.width * pixelRatio);\n chart.height = deviceHeight / pixelRatio;\n chart.width = deviceWidth / pixelRatio;\n const canvas = chart.canvas;\n if (canvas.style && (forceStyle || (!canvas.style.height && !canvas.style.width))) {\n canvas.style.height = `${chart.height}px`;\n canvas.style.width = `${chart.width}px`;\n }\n if (chart.currentDevicePixelRatio !== pixelRatio\n || canvas.height !== deviceHeight\n || canvas.width !== deviceWidth) {\n chart.currentDevicePixelRatio = pixelRatio;\n canvas.height = deviceHeight;\n canvas.width = deviceWidth;\n chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n return true;\n }\n return false;\n}\nconst supportsEventListenerOptions = (function() {\n let passiveSupported = false;\n try {\n const options = {\n get passive() {\n passiveSupported = true;\n return false;\n }\n };\n window.addEventListener('test', null, options);\n window.removeEventListener('test', null, options);\n } catch (e) {\n }\n return passiveSupported;\n}());\nfunction readUsedSize(element, property) {\n const value = getStyle(element, property);\n const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? +matches[1] : undefined;\n}\n\nfunction _pointInLine(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: p1.y + t * (p2.y - p1.y)\n };\n}\nfunction _steppedInterpolation(p1, p2, t, mode) {\n return {\n x: p1.x + t * (p2.x - p1.x),\n y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y\n : mode === 'after' ? t < 1 ? p1.y : p2.y\n : t > 0 ? p2.y : p1.y\n };\n}\nfunction _bezierInterpolation(p1, p2, t, mode) {\n const cp1 = {x: p1.cp2x, y: p1.cp2y};\n const cp2 = {x: p2.cp1x, y: p2.cp1y};\n const a = _pointInLine(p1, cp1, t);\n const b = _pointInLine(cp1, cp2, t);\n const c = _pointInLine(cp2, p2, t);\n const d = _pointInLine(a, b, t);\n const e = _pointInLine(b, c, t);\n return _pointInLine(d, e, t);\n}\n\nconst intlCache = new Map();\nfunction getNumberFormat(locale, options) {\n options = options || {};\n const cacheKey = locale + JSON.stringify(options);\n let formatter = intlCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, options);\n intlCache.set(cacheKey, formatter);\n }\n return formatter;\n}\nfunction formatNumber(num, locale, options) {\n return getNumberFormat(locale, options).format(num);\n}\n\nconst getRightToLeftAdapter = function(rectX, width) {\n return {\n x(x) {\n return rectX + rectX + width - x;\n },\n setWidth(w) {\n width = w;\n },\n textAlign(align) {\n if (align === 'center') {\n return align;\n }\n return align === 'right' ? 'left' : 'right';\n },\n xPlus(x, value) {\n return x - value;\n },\n leftForLtr(x, itemWidth) {\n return x - itemWidth;\n },\n };\n};\nconst getLeftToRightAdapter = function() {\n return {\n x(x) {\n return x;\n },\n setWidth(w) {\n },\n textAlign(align) {\n return align;\n },\n xPlus(x, value) {\n return x + value;\n },\n leftForLtr(x, _itemWidth) {\n return x;\n },\n };\n};\nfunction getRtlAdapter(rtl, rectX, width) {\n return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\nfunction overrideTextDirection(ctx, direction) {\n let style, original;\n if (direction === 'ltr' || direction === 'rtl') {\n style = ctx.canvas.style;\n original = [\n style.getPropertyValue('direction'),\n style.getPropertyPriority('direction'),\n ];\n style.setProperty('direction', direction, 'important');\n ctx.prevTextDirection = original;\n }\n}\nfunction restoreTextDirection(ctx, original) {\n if (original !== undefined) {\n delete ctx.prevTextDirection;\n ctx.canvas.style.setProperty('direction', original[0], original[1]);\n }\n}\n\nfunction propertyFn(property) {\n if (property === 'angle') {\n return {\n between: _angleBetween,\n compare: _angleDiff,\n normalize: _normalizeAngle,\n };\n }\n return {\n between: _isBetween,\n compare: (a, b) => a - b,\n normalize: x => x\n };\n}\nfunction normalizeSegment({start, end, count, loop, style}) {\n return {\n start: start % count,\n end: end % count,\n loop: loop && (end - start + 1) % count === 0,\n style\n };\n}\nfunction getSegment(segment, points, bounds) {\n const {property, start: startBound, end: endBound} = bounds;\n const {between, normalize} = propertyFn(property);\n const count = points.length;\n let {start, end, loop} = segment;\n let i, ilen;\n if (loop) {\n start += count;\n end += count;\n for (i = 0, ilen = count; i < ilen; ++i) {\n if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n break;\n }\n start--;\n end--;\n }\n start %= count;\n end %= count;\n }\n if (end < start) {\n end += count;\n }\n return {start, end, loop, style: segment.style};\n}\nfunction _boundSegment(segment, points, bounds) {\n if (!bounds) {\n return [segment];\n }\n const {property, start: startBound, end: endBound} = bounds;\n const count = points.length;\n const {compare, between, normalize} = propertyFn(property);\n const {start, end, loop, style} = getSegment(segment, points, bounds);\n const result = [];\n let inside = false;\n let subStart = null;\n let value, point, prevValue;\n const startIsBefore = () => between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n const endIsBefore = () => compare(endBound, value) === 0 || between(endBound, prevValue, value);\n const shouldStart = () => inside || startIsBefore();\n const shouldStop = () => !inside || endIsBefore();\n for (let i = start, prev = start; i <= end; ++i) {\n point = points[i % count];\n if (point.skip) {\n continue;\n }\n value = normalize(point[property]);\n if (value === prevValue) {\n continue;\n }\n inside = between(value, startBound, endBound);\n if (subStart === null && shouldStart()) {\n subStart = compare(value, startBound) === 0 ? i : prev;\n }\n if (subStart !== null && shouldStop()) {\n result.push(normalizeSegment({start: subStart, end: i, loop, count, style}));\n subStart = null;\n }\n prev = i;\n prevValue = value;\n }\n if (subStart !== null) {\n result.push(normalizeSegment({start: subStart, end, loop, count, style}));\n }\n return result;\n}\nfunction _boundSegments(line, bounds) {\n const result = [];\n const segments = line.segments;\n for (let i = 0; i < segments.length; i++) {\n const sub = _boundSegment(segments[i], line.points, bounds);\n if (sub.length) {\n result.push(...sub);\n }\n }\n return result;\n}\nfunction findStartAndEnd(points, count, loop, spanGaps) {\n let start = 0;\n let end = count - 1;\n if (loop && !spanGaps) {\n while (start < count && !points[start].skip) {\n start++;\n }\n }\n while (start < count && points[start].skip) {\n start++;\n }\n start %= count;\n if (loop) {\n end += start;\n }\n while (end > start && points[end % count].skip) {\n end--;\n }\n end %= count;\n return {start, end};\n}\nfunction solidSegments(points, start, max, loop) {\n const count = points.length;\n const result = [];\n let last = start;\n let prev = points[start];\n let end;\n for (end = start + 1; end <= max; ++end) {\n const cur = points[end % count];\n if (cur.skip || cur.stop) {\n if (!prev.skip) {\n loop = false;\n result.push({start: start % count, end: (end - 1) % count, loop});\n start = last = cur.stop ? end : null;\n }\n } else {\n last = end;\n if (prev.skip) {\n start = end;\n }\n }\n prev = cur;\n }\n if (last !== null) {\n result.push({start: start % count, end: last % count, loop});\n }\n return result;\n}\nfunction _computeSegments(line, segmentOptions) {\n const points = line.points;\n const spanGaps = line.options.spanGaps;\n const count = points.length;\n if (!count) {\n return [];\n }\n const loop = !!line._loop;\n const {start, end} = findStartAndEnd(points, count, loop, spanGaps);\n if (spanGaps === true) {\n return splitByStyles(line, [{start, end, loop}], points, segmentOptions);\n }\n const max = end < start ? end + count : end;\n const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\nfunction splitByStyles(line, segments, points, segmentOptions) {\n if (!segmentOptions || !segmentOptions.setContext || !points) {\n return segments;\n }\n return doSplitByStyles(line, segments, points, segmentOptions);\n}\nfunction doSplitByStyles(line, segments, points, segmentOptions) {\n const chartContext = line._chart.getContext();\n const baseStyle = readStyle(line.options);\n const {_datasetIndex: datasetIndex, options: {spanGaps}} = line;\n const count = points.length;\n const result = [];\n let prevStyle = baseStyle;\n let start = segments[0].start;\n let i = start;\n function addStyle(s, e, l, st) {\n const dir = spanGaps ? -1 : 1;\n if (s === e) {\n return;\n }\n s += count;\n while (points[s % count].skip) {\n s -= dir;\n }\n while (points[e % count].skip) {\n e += dir;\n }\n if (s % count !== e % count) {\n result.push({start: s % count, end: e % count, loop: l, style: st});\n prevStyle = st;\n start = e % count;\n }\n }\n for (const segment of segments) {\n start = spanGaps ? start : segment.start;\n let prev = points[start % count];\n let style;\n for (i = start + 1; i <= segment.end; i++) {\n const pt = points[i % count];\n style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n type: 'segment',\n p0: prev,\n p1: pt,\n p0DataIndex: (i - 1) % count,\n p1DataIndex: i % count,\n datasetIndex\n })));\n if (styleChanged(style, prevStyle)) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n prev = pt;\n prevStyle = style;\n }\n if (start < i - 1) {\n addStyle(start, i - 1, segment.loop, prevStyle);\n }\n }\n return result;\n}\nfunction readStyle(options) {\n return {\n backgroundColor: options.backgroundColor,\n borderCapStyle: options.borderCapStyle,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderJoinStyle: options.borderJoinStyle,\n borderWidth: options.borderWidth,\n borderColor: options.borderColor\n };\n}\nfunction styleChanged(style, prevStyle) {\n return prevStyle && JSON.stringify(style) !== JSON.stringify(prevStyle);\n}\n\nexport { _toLeftRightCenter as $, _rlookupByKey as A, getAngleFromPoint as B, toPadding as C, each as D, getMaximumSize as E, _getParentNode as F, readUsedSize as G, HALF_PI as H, throttled as I, supportsEventListenerOptions as J, _isDomSupported as K, log10 as L, _factorize as M, finiteOrDefault as N, callback as O, PI as P, _addGrace as Q, toDegrees as R, _measureText as S, TAU as T, _int16Range as U, _alignPixel as V, clipArea as W, renderText as X, unclipArea as Y, toFont as Z, _arrayUnique as _, resolve as a, _angleDiff as a$, _alignStartEnd as a0, overrides as a1, merge as a2, _capitalize as a3, descriptors as a4, isFunction as a5, _attachContext as a6, _createResolver as a7, _descriptors as a8, mergeIf as a9, restoreTextDirection as aA, noop as aB, distanceBetweenPoints as aC, _setMinAndMaxByKey as aD, niceNum as aE, almostWhole as aF, almostEquals as aG, _decimalPlaces as aH, _longestText as aI, _filterBetween as aJ, _lookup as aK, getHoverColor as aL, clone$1 as aM, _merger as aN, _mergerIf as aO, _deprecated as aP, toFontString as aQ, splineCurve as aR, splineCurveMonotone as aS, getStyle as aT, fontString as aU, toLineHeight as aV, PITAU as aW, INFINITY as aX, RAD_PER_DEG as aY, QUARTER_PI as aZ, TWO_THIRDS_PI as a_, uid as aa, debounce as ab, retinaScale as ac, clearCanvas as ad, setsEqual as ae, _elementsEqual as af, _isClickEvent as ag, _isBetween as ah, _readValueToProps as ai, _updateBezierControlPoints as aj, _computeSegments as ak, _boundSegments as al, _steppedInterpolation as am, _bezierInterpolation as an, _pointInLine as ao, _steppedLineTo as ap, _bezierCurveTo as aq, drawPoint as ar, addRoundedRectPath as as, toTRBL as at, toTRBLCorners as au, _boundSegment as av, _normalizeAngle as aw, getRtlAdapter as ax, overrideTextDirection as ay, _textX as az, isArray as b, color as c, defaults as d, effects as e, resolveObjectKey as f, isNumberFinite as g, createContext as h, isObject as i, defined as j, isNullOrUndef as k, listenArrayEvents as l, toPercentage as m, toDimension as n, formatNumber as o, _angleBetween as p, isNumber as q, requestAnimFrame as r, sign as s, toRadians as t, unlistenArrayEvents as u, valueOrDefault as v, _limitValue as w, _lookupByKey as x, getRelativePosition as y, _isPointInArea as z };\n","/*!\n * Chart.js v3.7.1\n * https://www.chartjs.org\n * (c) 2022 Chart.js Contributors\n * Released under the MIT License\n */\nimport { r as requestAnimFrame, a as resolve, e as effects, c as color, d as defaults, i as isObject, b as isArray, v as valueOrDefault, u as unlistenArrayEvents, l as listenArrayEvents, f as resolveObjectKey, g as isNumberFinite, h as createContext, j as defined, s as sign, k as isNullOrUndef, _ as _arrayUnique, t as toRadians, m as toPercentage, n as toDimension, T as TAU, o as formatNumber, p as _angleBetween, H as HALF_PI, P as PI, q as isNumber, w as _limitValue, x as _lookupByKey, y as getRelativePosition$1, z as _isPointInArea, A as _rlookupByKey, B as getAngleFromPoint, C as toPadding, D as each, E as getMaximumSize, F as _getParentNode, G as readUsedSize, I as throttled, J as supportsEventListenerOptions, K as _isDomSupported, L as log10, M as _factorize, N as finiteOrDefault, O as callback, Q as _addGrace, R as toDegrees, S as _measureText, U as _int16Range, V as _alignPixel, W as clipArea, X as renderText, Y as unclipArea, Z as toFont, $ as _toLeftRightCenter, a0 as _alignStartEnd, a1 as overrides, a2 as merge, a3 as _capitalize, a4 as descriptors, a5 as isFunction, a6 as _attachContext, a7 as _createResolver, a8 as _descriptors, a9 as mergeIf, aa as uid, ab as debounce, ac as retinaScale, ad as clearCanvas, ae as setsEqual, af as _elementsEqual, ag as _isClickEvent, ah as _isBetween, ai as _readValueToProps, aj as _updateBezierControlPoints, ak as _computeSegments, al as _boundSegments, am as _steppedInterpolation, an as _bezierInterpolation, ao as _pointInLine, ap as _steppedLineTo, aq as _bezierCurveTo, ar as drawPoint, as as addRoundedRectPath, at as toTRBL, au as toTRBLCorners, av as _boundSegment, aw as _normalizeAngle, ax as getRtlAdapter, ay as overrideTextDirection, az as _textX, aA as restoreTextDirection, aB as noop, aC as distanceBetweenPoints, aD as _setMinAndMaxByKey, aE as niceNum, aF as almostWhole, aG as almostEquals, aH as _decimalPlaces, aI as _longestText, aJ as _filterBetween, aK as _lookup } from './chunks/helpers.segment.js';\nexport { d as defaults } from './chunks/helpers.segment.js';\n\nclass Animator {\n constructor() {\n this._request = null;\n this._charts = new Map();\n this._running = false;\n this._lastDate = undefined;\n }\n _notify(chart, anims, date, type) {\n const callbacks = anims.listeners[type];\n const numSteps = anims.duration;\n callbacks.forEach(fn => fn({\n chart,\n initial: anims.initial,\n numSteps,\n currentStep: Math.min(date - anims.start, numSteps)\n }));\n }\n _refresh() {\n if (this._request) {\n return;\n }\n this._running = true;\n this._request = requestAnimFrame.call(window, () => {\n this._update();\n this._request = null;\n if (this._running) {\n this._refresh();\n }\n });\n }\n _update(date = Date.now()) {\n let remaining = 0;\n this._charts.forEach((anims, chart) => {\n if (!anims.running || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n let draw = false;\n let item;\n for (; i >= 0; --i) {\n item = items[i];\n if (item._active) {\n if (item._total > anims.duration) {\n anims.duration = item._total;\n }\n item.tick(date);\n draw = true;\n } else {\n items[i] = items[items.length - 1];\n items.pop();\n }\n }\n if (draw) {\n chart.draw();\n this._notify(chart, anims, date, 'progress');\n }\n if (!items.length) {\n anims.running = false;\n this._notify(chart, anims, date, 'complete');\n anims.initial = false;\n }\n remaining += items.length;\n });\n this._lastDate = date;\n if (remaining === 0) {\n this._running = false;\n }\n }\n _getAnims(chart) {\n const charts = this._charts;\n let anims = charts.get(chart);\n if (!anims) {\n anims = {\n running: false,\n initial: true,\n items: [],\n listeners: {\n complete: [],\n progress: []\n }\n };\n charts.set(chart, anims);\n }\n return anims;\n }\n listen(chart, event, cb) {\n this._getAnims(chart).listeners[event].push(cb);\n }\n add(chart, items) {\n if (!items || !items.length) {\n return;\n }\n this._getAnims(chart).items.push(...items);\n }\n has(chart) {\n return this._getAnims(chart).items.length > 0;\n }\n start(chart) {\n const anims = this._charts.get(chart);\n if (!anims) {\n return;\n }\n anims.running = true;\n anims.start = Date.now();\n anims.duration = anims.items.reduce((acc, cur) => Math.max(acc, cur._duration), 0);\n this._refresh();\n }\n running(chart) {\n if (!this._running) {\n return false;\n }\n const anims = this._charts.get(chart);\n if (!anims || !anims.running || !anims.items.length) {\n return false;\n }\n return true;\n }\n stop(chart) {\n const anims = this._charts.get(chart);\n if (!anims || !anims.items.length) {\n return;\n }\n const items = anims.items;\n let i = items.length - 1;\n for (; i >= 0; --i) {\n items[i].cancel();\n }\n anims.items = [];\n this._notify(chart, anims, Date.now(), 'complete');\n }\n remove(chart) {\n return this._charts.delete(chart);\n }\n}\nvar animator = new Animator();\n\nconst transparent = 'transparent';\nconst interpolators = {\n boolean(from, to, factor) {\n return factor > 0.5 ? to : from;\n },\n color(from, to, factor) {\n const c0 = color(from || transparent);\n const c1 = c0.valid && color(to || transparent);\n return c1 && c1.valid\n ? c1.mix(c0, factor).hexString()\n : to;\n },\n number(from, to, factor) {\n return from + (to - from) * factor;\n }\n};\nclass Animation {\n constructor(cfg, target, prop, to) {\n const currentValue = target[prop];\n to = resolve([cfg.to, to, currentValue, cfg.from]);\n const from = resolve([cfg.from, currentValue, to]);\n this._active = true;\n this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n this._easing = effects[cfg.easing] || effects.linear;\n this._start = Math.floor(Date.now() + (cfg.delay || 0));\n this._duration = this._total = Math.floor(cfg.duration);\n this._loop = !!cfg.loop;\n this._target = target;\n this._prop = prop;\n this._from = from;\n this._to = to;\n this._promises = undefined;\n }\n active() {\n return this._active;\n }\n update(cfg, to, date) {\n if (this._active) {\n this._notify(false);\n const currentValue = this._target[this._prop];\n const elapsed = date - this._start;\n const remain = this._duration - elapsed;\n this._start = date;\n this._duration = Math.floor(Math.max(remain, cfg.duration));\n this._total += elapsed;\n this._loop = !!cfg.loop;\n this._to = resolve([cfg.to, to, currentValue, cfg.from]);\n this._from = resolve([cfg.from, currentValue, to]);\n }\n }\n cancel() {\n if (this._active) {\n this.tick(Date.now());\n this._active = false;\n this._notify(false);\n }\n }\n tick(date) {\n const elapsed = date - this._start;\n const duration = this._duration;\n const prop = this._prop;\n const from = this._from;\n const loop = this._loop;\n const to = this._to;\n let factor;\n this._active = from !== to && (loop || (elapsed < duration));\n if (!this._active) {\n this._target[prop] = to;\n this._notify(true);\n return;\n }\n if (elapsed < 0) {\n this._target[prop] = from;\n return;\n }\n factor = (elapsed / duration) % 2;\n factor = loop && factor > 1 ? 2 - factor : factor;\n factor = this._easing(Math.min(1, Math.max(0, factor)));\n this._target[prop] = this._fn(from, to, factor);\n }\n wait() {\n const promises = this._promises || (this._promises = []);\n return new Promise((res, rej) => {\n promises.push({res, rej});\n });\n }\n _notify(resolved) {\n const method = resolved ? 'res' : 'rej';\n const promises = this._promises || [];\n for (let i = 0; i < promises.length; i++) {\n promises[i][method]();\n }\n }\n}\n\nconst numbers = ['x', 'y', 'borderWidth', 'radius', 'tension'];\nconst colors = ['color', 'borderColor', 'backgroundColor'];\ndefaults.set('animation', {\n delay: undefined,\n duration: 1000,\n easing: 'easeOutQuart',\n fn: undefined,\n from: undefined,\n loop: undefined,\n to: undefined,\n type: undefined,\n});\nconst animationOptions = Object.keys(defaults.animation);\ndefaults.describe('animation', {\n _fallback: false,\n _indexable: false,\n _scriptable: (name) => name !== 'onProgress' && name !== 'onComplete' && name !== 'fn',\n});\ndefaults.set('animations', {\n colors: {\n type: 'color',\n properties: colors\n },\n numbers: {\n type: 'number',\n properties: numbers\n },\n});\ndefaults.describe('animations', {\n _fallback: 'animation',\n});\ndefaults.set('transitions', {\n active: {\n animation: {\n duration: 400\n }\n },\n resize: {\n animation: {\n duration: 0\n }\n },\n show: {\n animations: {\n colors: {\n from: 'transparent'\n },\n visible: {\n type: 'boolean',\n duration: 0\n },\n }\n },\n hide: {\n animations: {\n colors: {\n to: 'transparent'\n },\n visible: {\n type: 'boolean',\n easing: 'linear',\n fn: v => v | 0\n },\n }\n }\n});\nclass Animations {\n constructor(chart, config) {\n this._chart = chart;\n this._properties = new Map();\n this.configure(config);\n }\n configure(config) {\n if (!isObject(config)) {\n return;\n }\n const animatedProps = this._properties;\n Object.getOwnPropertyNames(config).forEach(key => {\n const cfg = config[key];\n if (!isObject(cfg)) {\n return;\n }\n const resolved = {};\n for (const option of animationOptions) {\n resolved[option] = cfg[option];\n }\n (isArray(cfg.properties) && cfg.properties || [key]).forEach((prop) => {\n if (prop === key || !animatedProps.has(prop)) {\n animatedProps.set(prop, resolved);\n }\n });\n });\n }\n _animateOptions(target, values) {\n const newOptions = values.options;\n const options = resolveTargetOptions(target, newOptions);\n if (!options) {\n return [];\n }\n const animations = this._createAnimations(options, newOptions);\n if (newOptions.$shared) {\n awaitAll(target.options.$animations, newOptions).then(() => {\n target.options = newOptions;\n }, () => {\n });\n }\n return animations;\n }\n _createAnimations(target, values) {\n const animatedProps = this._properties;\n const animations = [];\n const running = target.$animations || (target.$animations = {});\n const props = Object.keys(values);\n const date = Date.now();\n let i;\n for (i = props.length - 1; i >= 0; --i) {\n const prop = props[i];\n if (prop.charAt(0) === '$') {\n continue;\n }\n if (prop === 'options') {\n animations.push(...this._animateOptions(target, values));\n continue;\n }\n const value = values[prop];\n let animation = running[prop];\n const cfg = animatedProps.get(prop);\n if (animation) {\n if (cfg && animation.active()) {\n animation.update(cfg, value, date);\n continue;\n } else {\n animation.cancel();\n }\n }\n if (!cfg || !cfg.duration) {\n target[prop] = value;\n continue;\n }\n running[prop] = animation = new Animation(cfg, target, prop, value);\n animations.push(animation);\n }\n return animations;\n }\n update(target, values) {\n if (this._properties.size === 0) {\n Object.assign(target, values);\n return;\n }\n const animations = this._createAnimations(target, values);\n if (animations.length) {\n animator.add(this._chart, animations);\n return true;\n }\n }\n}\nfunction awaitAll(animations, properties) {\n const running = [];\n const keys = Object.keys(properties);\n for (let i = 0; i < keys.length; i++) {\n const anim = animations[keys[i]];\n if (anim && anim.active()) {\n running.push(anim.wait());\n }\n }\n return Promise.all(running);\n}\nfunction resolveTargetOptions(target, newOptions) {\n if (!newOptions) {\n return;\n }\n let options = target.options;\n if (!options) {\n target.options = newOptions;\n return;\n }\n if (options.$shared) {\n target.options = options = Object.assign({}, options, {$shared: false, $animations: {}});\n }\n return options;\n}\n\nfunction scaleClip(scale, allowedOverflow) {\n const opts = scale && scale.options || {};\n const reverse = opts.reverse;\n const min = opts.min === undefined ? allowedOverflow : 0;\n const max = opts.max === undefined ? allowedOverflow : 0;\n return {\n start: reverse ? max : min,\n end: reverse ? min : max\n };\n}\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n if (allowedOverflow === false) {\n return false;\n }\n const x = scaleClip(xScale, allowedOverflow);\n const y = scaleClip(yScale, allowedOverflow);\n return {\n top: y.end,\n right: x.end,\n bottom: y.start,\n left: x.start\n };\n}\nfunction toClip(value) {\n let t, r, b, l;\n if (isObject(value)) {\n t = value.top;\n r = value.right;\n b = value.bottom;\n l = value.left;\n } else {\n t = r = b = l = value;\n }\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n disabled: value === false\n };\n}\nfunction getSortedDatasetIndices(chart, filterVisible) {\n const keys = [];\n const metasets = chart._getSortedDatasetMetas(filterVisible);\n let i, ilen;\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n keys.push(metasets[i].index);\n }\n return keys;\n}\nfunction applyStack(stack, value, dsIndex, options = {}) {\n const keys = stack.keys;\n const singleMode = options.mode === 'single';\n let i, ilen, datasetIndex, otherValue;\n if (value === null) {\n return;\n }\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n datasetIndex = +keys[i];\n if (datasetIndex === dsIndex) {\n if (options.all) {\n continue;\n }\n break;\n }\n otherValue = stack.values[datasetIndex];\n if (isNumberFinite(otherValue) && (singleMode || (value === 0 || sign(value) === sign(otherValue)))) {\n value += otherValue;\n }\n }\n return value;\n}\nfunction convertObjectDataToArray(data) {\n const keys = Object.keys(data);\n const adata = new Array(keys.length);\n let i, ilen, key;\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n key = keys[i];\n adata[i] = {\n x: key,\n y: data[key]\n };\n }\n return adata;\n}\nfunction isStacked(scale, meta) {\n const stacked = scale && scale.options.stacked;\n return stacked || (stacked === undefined && meta.stack !== undefined);\n}\nfunction getStackKey(indexScale, valueScale, meta) {\n return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\nfunction getUserBounds(scale) {\n const {min, max, minDefined, maxDefined} = scale.getUserBounds();\n return {\n min: minDefined ? min : Number.NEGATIVE_INFINITY,\n max: maxDefined ? max : Number.POSITIVE_INFINITY\n };\n}\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n return subStack[indexValue] || (subStack[indexValue] = {});\n}\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n for (const meta of vScale.getMatchingVisibleMetas(type).reverse()) {\n const value = stack[meta.index];\n if ((positive && value > 0) || (!positive && value < 0)) {\n return meta.index;\n }\n }\n return null;\n}\nfunction updateStacks(controller, parsed) {\n const {chart, _cachedMeta: meta} = controller;\n const stacks = chart._stacks || (chart._stacks = {});\n const {iScale, vScale, index: datasetIndex} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const key = getStackKey(iScale, vScale, meta);\n const ilen = parsed.length;\n let stack;\n for (let i = 0; i < ilen; ++i) {\n const item = parsed[i];\n const {[iAxis]: index, [vAxis]: value} = item;\n const itemStacks = item._stacks || (item._stacks = {});\n stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n stack[datasetIndex] = value;\n stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n }\n}\nfunction getFirstScaleId(chart, axis) {\n const scales = chart.scales;\n return Object.keys(scales).filter(key => scales[key].axis === axis).shift();\n}\nfunction createDatasetContext(parent, index) {\n return createContext(parent,\n {\n active: false,\n dataset: undefined,\n datasetIndex: index,\n index,\n mode: 'default',\n type: 'dataset'\n }\n );\n}\nfunction createDataContext(parent, index, element) {\n return createContext(parent, {\n active: false,\n dataIndex: index,\n parsed: undefined,\n raw: undefined,\n element,\n index,\n mode: 'default',\n type: 'data'\n });\n}\nfunction clearStacks(meta, items) {\n const datasetIndex = meta.controller.index;\n const axis = meta.vScale && meta.vScale.axis;\n if (!axis) {\n return;\n }\n items = items || meta._parsed;\n for (const parsed of items) {\n const stacks = parsed._stacks;\n if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n return;\n }\n delete stacks[axis][datasetIndex];\n }\n}\nconst isDirectUpdateMode = (mode) => mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart) => canStack && !meta.hidden && meta._stacked\n && {keys: getSortedDatasetIndices(chart, true), values: null};\nclass DatasetController {\n constructor(chart, datasetIndex) {\n this.chart = chart;\n this._ctx = chart.ctx;\n this.index = datasetIndex;\n this._cachedDataOpts = {};\n this._cachedMeta = this.getMeta();\n this._type = this._cachedMeta.type;\n this.options = undefined;\n this._parsing = false;\n this._data = undefined;\n this._objectData = undefined;\n this._sharedOptions = undefined;\n this._drawStart = undefined;\n this._drawCount = undefined;\n this.enableOptionSharing = false;\n this.$context = undefined;\n this._syncList = [];\n this.initialize();\n }\n initialize() {\n const meta = this._cachedMeta;\n this.configure();\n this.linkScales();\n meta._stacked = isStacked(meta.vScale, meta);\n this.addElements();\n }\n updateIndex(datasetIndex) {\n if (this.index !== datasetIndex) {\n clearStacks(this._cachedMeta);\n }\n this.index = datasetIndex;\n }\n linkScales() {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n const chooseId = (axis, x, y, r) => axis === 'x' ? x : axis === 'r' ? r : y;\n const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n const indexAxis = meta.indexAxis;\n const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n meta.xScale = this.getScaleForId(xid);\n meta.yScale = this.getScaleForId(yid);\n meta.rScale = this.getScaleForId(rid);\n meta.iScale = this.getScaleForId(iid);\n meta.vScale = this.getScaleForId(vid);\n }\n getDataset() {\n return this.chart.data.datasets[this.index];\n }\n getMeta() {\n return this.chart.getDatasetMeta(this.index);\n }\n getScaleForId(scaleID) {\n return this.chart.scales[scaleID];\n }\n _getOtherScale(scale) {\n const meta = this._cachedMeta;\n return scale === meta.iScale\n ? meta.vScale\n : meta.iScale;\n }\n reset() {\n this._update('reset');\n }\n _destroy() {\n const meta = this._cachedMeta;\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n if (meta._stacked) {\n clearStacks(meta);\n }\n }\n _dataCheck() {\n const dataset = this.getDataset();\n const data = dataset.data || (dataset.data = []);\n const _data = this._data;\n if (isObject(data)) {\n this._data = convertObjectDataToArray(data);\n } else if (_data !== data) {\n if (_data) {\n unlistenArrayEvents(_data, this);\n const meta = this._cachedMeta;\n clearStacks(meta);\n meta._parsed = [];\n }\n if (data && Object.isExtensible(data)) {\n listenArrayEvents(data, this);\n }\n this._syncList = [];\n this._data = data;\n }\n }\n addElements() {\n const meta = this._cachedMeta;\n this._dataCheck();\n if (this.datasetElementType) {\n meta.dataset = new this.datasetElementType();\n }\n }\n buildOrUpdateElements(resetNewElements) {\n const meta = this._cachedMeta;\n const dataset = this.getDataset();\n let stackChanged = false;\n this._dataCheck();\n const oldStacked = meta._stacked;\n meta._stacked = isStacked(meta.vScale, meta);\n if (meta.stack !== dataset.stack) {\n stackChanged = true;\n clearStacks(meta);\n meta.stack = dataset.stack;\n }\n this._resyncElements(resetNewElements);\n if (stackChanged || oldStacked !== meta._stacked) {\n updateStacks(this, meta._parsed);\n }\n }\n configure() {\n const config = this.chart.config;\n const scopeKeys = config.datasetScopeKeys(this._type);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n this.options = config.createResolver(scopes, this.getContext());\n this._parsing = this.options.parsing;\n this._cachedDataOpts = {};\n }\n parse(start, count) {\n const {_cachedMeta: meta, _data: data} = this;\n const {iScale, _stacked} = meta;\n const iAxis = iScale.axis;\n let sorted = start === 0 && count === data.length ? true : meta._sorted;\n let prev = start > 0 && meta._parsed[start - 1];\n let i, cur, parsed;\n if (this._parsing === false) {\n meta._parsed = data;\n meta._sorted = true;\n parsed = data;\n } else {\n if (isArray(data[start])) {\n parsed = this.parseArrayData(meta, data, start, count);\n } else if (isObject(data[start])) {\n parsed = this.parseObjectData(meta, data, start, count);\n } else {\n parsed = this.parsePrimitiveData(meta, data, start, count);\n }\n const isNotInOrderComparedToPrev = () => cur[iAxis] === null || (prev && cur[iAxis] < prev[iAxis]);\n for (i = 0; i < count; ++i) {\n meta._parsed[i + start] = cur = parsed[i];\n if (sorted) {\n if (isNotInOrderComparedToPrev()) {\n sorted = false;\n }\n prev = cur;\n }\n }\n meta._sorted = sorted;\n }\n if (_stacked) {\n updateStacks(this, parsed);\n }\n }\n parsePrimitiveData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = new Array(count);\n let i, ilen, index;\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n parsed[i] = {\n [iAxis]: singleScale || iScale.parse(labels[index], index),\n [vAxis]: vScale.parse(data[index], index)\n };\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(item[0], index),\n y: yScale.parse(item[1], index)\n };\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const {xScale, yScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const parsed = new Array(count);\n let i, ilen, index, item;\n for (i = 0, ilen = count; i < ilen; ++i) {\n index = i + start;\n item = data[index];\n parsed[i] = {\n x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n };\n }\n return parsed;\n }\n getParsed(index) {\n return this._cachedMeta._parsed[index];\n }\n getDataElement(index) {\n return this._cachedMeta.data[index];\n }\n applyStack(scale, parsed, mode) {\n const chart = this.chart;\n const meta = this._cachedMeta;\n const value = parsed[scale.axis];\n const stack = {\n keys: getSortedDatasetIndices(chart, true),\n values: parsed._stacks[scale.axis]\n };\n return applyStack(stack, value, meta.index, {mode});\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n const parsedValue = parsed[scale.axis];\n let value = parsedValue === null ? NaN : parsedValue;\n const values = stack && parsed._stacks[scale.axis];\n if (stack && values) {\n stack.values = values;\n value = applyStack(stack, parsedValue, this._cachedMeta.index);\n }\n range.min = Math.min(range.min, value);\n range.max = Math.max(range.max, value);\n }\n getMinMax(scale, canStack) {\n const meta = this._cachedMeta;\n const _parsed = meta._parsed;\n const sorted = meta._sorted && scale === meta.iScale;\n const ilen = _parsed.length;\n const otherScale = this._getOtherScale(scale);\n const stack = createStack(canStack, meta, this.chart);\n const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n const {min: otherMin, max: otherMax} = getUserBounds(otherScale);\n let i, parsed;\n function _skip() {\n parsed = _parsed[i];\n const otherValue = parsed[otherScale.axis];\n return !isNumberFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n }\n for (i = 0; i < ilen; ++i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n if (sorted) {\n break;\n }\n }\n if (sorted) {\n for (i = ilen - 1; i >= 0; --i) {\n if (_skip()) {\n continue;\n }\n this.updateRangeFromParsed(range, scale, parsed, stack);\n break;\n }\n }\n return range;\n }\n getAllParsedValues(scale) {\n const parsed = this._cachedMeta._parsed;\n const values = [];\n let i, ilen, value;\n for (i = 0, ilen = parsed.length; i < ilen; ++i) {\n value = parsed[i][scale.axis];\n if (isNumberFinite(value)) {\n values.push(value);\n }\n }\n return values;\n }\n getMaxOverflow() {\n return false;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n };\n }\n _update(mode) {\n const meta = this._cachedMeta;\n this.update(mode || 'default');\n meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n }\n update(mode) {}\n draw() {\n const ctx = this._ctx;\n const chart = this.chart;\n const meta = this._cachedMeta;\n const elements = meta.data || [];\n const area = chart.chartArea;\n const active = [];\n const start = this._drawStart || 0;\n const count = this._drawCount || (elements.length - start);\n const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n let i;\n if (meta.dataset) {\n meta.dataset.draw(ctx, area, start, count);\n }\n for (i = start; i < start + count; ++i) {\n const element = elements[i];\n if (element.hidden) {\n continue;\n }\n if (element.active && drawActiveElementsOnTop) {\n active.push(element);\n } else {\n element.draw(ctx, area);\n }\n }\n for (i = 0; i < active.length; ++i) {\n active[i].draw(ctx, area);\n }\n }\n getStyle(index, active) {\n const mode = active ? 'active' : 'default';\n return index === undefined && this._cachedMeta.dataset\n ? this.resolveDatasetElementOptions(mode)\n : this.resolveDataElementOptions(index || 0, mode);\n }\n getContext(index, active, mode) {\n const dataset = this.getDataset();\n let context;\n if (index >= 0 && index < this._cachedMeta.data.length) {\n const element = this._cachedMeta.data[index];\n context = element.$context ||\n (element.$context = createDataContext(this.getContext(), index, element));\n context.parsed = this.getParsed(index);\n context.raw = dataset.data[index];\n context.index = context.dataIndex = index;\n } else {\n context = this.$context ||\n (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n context.dataset = dataset;\n context.index = context.datasetIndex = this.index;\n }\n context.active = !!active;\n context.mode = mode;\n return context;\n }\n resolveDatasetElementOptions(mode) {\n return this._resolveElementOptions(this.datasetElementType.id, mode);\n }\n resolveDataElementOptions(index, mode) {\n return this._resolveElementOptions(this.dataElementType.id, mode, index);\n }\n _resolveElementOptions(elementType, mode = 'default', index) {\n const active = mode === 'active';\n const cache = this._cachedDataOpts;\n const cacheKey = elementType + '-' + mode;\n const cached = cache[cacheKey];\n const sharing = this.enableOptionSharing && defined(index);\n if (cached) {\n return cloneIfNotShared(cached, sharing);\n }\n const config = this.chart.config;\n const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n const prefixes = active ? [`${elementType}Hover`, 'hover', elementType, ''] : [elementType, ''];\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n const names = Object.keys(defaults.elements[elementType]);\n const context = () => this.getContext(index, active);\n const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n if (values.$shared) {\n values.$shared = sharing;\n cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n }\n return values;\n }\n _resolveAnimations(index, transition, active) {\n const chart = this.chart;\n const cache = this._cachedDataOpts;\n const cacheKey = `animation-${transition}`;\n const cached = cache[cacheKey];\n if (cached) {\n return cached;\n }\n let options;\n if (chart.options.animation !== false) {\n const config = this.chart.config;\n const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n options = config.createResolver(scopes, this.getContext(index, active, transition));\n }\n const animations = new Animations(chart, options && options.animations);\n if (options && options._cacheable) {\n cache[cacheKey] = Object.freeze(animations);\n }\n return animations;\n }\n getSharedOptions(options) {\n if (!options.$shared) {\n return;\n }\n return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n }\n includeOptions(mode, sharedOptions) {\n return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n }\n updateElement(element, index, properties, mode) {\n if (isDirectUpdateMode(mode)) {\n Object.assign(element, properties);\n } else {\n this._resolveAnimations(index, mode).update(element, properties);\n }\n }\n updateSharedOptions(sharedOptions, mode, newOptions) {\n if (sharedOptions && !isDirectUpdateMode(mode)) {\n this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n }\n }\n _setStyle(element, index, mode, active) {\n element.active = active;\n const options = this.getStyle(index, active);\n this._resolveAnimations(index, mode, active).update(element, {\n options: (!active && this.getSharedOptions(options)) || options\n });\n }\n removeHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', false);\n }\n setHoverStyle(element, datasetIndex, index) {\n this._setStyle(element, index, 'active', true);\n }\n _removeDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', false);\n }\n }\n _setDatasetHoverStyle() {\n const element = this._cachedMeta.dataset;\n if (element) {\n this._setStyle(element, undefined, 'active', true);\n }\n }\n _resyncElements(resetNewElements) {\n const data = this._data;\n const elements = this._cachedMeta.data;\n for (const [method, arg1, arg2] of this._syncList) {\n this[method](arg1, arg2);\n }\n this._syncList = [];\n const numMeta = elements.length;\n const numData = data.length;\n const count = Math.min(numData, numMeta);\n if (count) {\n this.parse(0, count);\n }\n if (numData > numMeta) {\n this._insertElements(numMeta, numData - numMeta, resetNewElements);\n } else if (numData < numMeta) {\n this._removeElements(numData, numMeta - numData);\n }\n }\n _insertElements(start, count, resetNewElements = true) {\n const meta = this._cachedMeta;\n const data = meta.data;\n const end = start + count;\n let i;\n const move = (arr) => {\n arr.length += count;\n for (i = arr.length - 1; i >= end; i--) {\n arr[i] = arr[i - count];\n }\n };\n move(data);\n for (i = start; i < end; ++i) {\n data[i] = new this.dataElementType();\n }\n if (this._parsing) {\n move(meta._parsed);\n }\n this.parse(start, count);\n if (resetNewElements) {\n this.updateElements(data, start, count, 'reset');\n }\n }\n updateElements(element, start, count, mode) {}\n _removeElements(start, count) {\n const meta = this._cachedMeta;\n if (this._parsing) {\n const removed = meta._parsed.splice(start, count);\n if (meta._stacked) {\n clearStacks(meta, removed);\n }\n }\n meta.data.splice(start, count);\n }\n _sync(args) {\n if (this._parsing) {\n this._syncList.push(args);\n } else {\n const [method, arg1, arg2] = args;\n this[method](arg1, arg2);\n }\n this.chart._dataChanges.push([this.index, ...args]);\n }\n _onDataPush() {\n const count = arguments.length;\n this._sync(['_insertElements', this.getDataset().data.length - count, count]);\n }\n _onDataPop() {\n this._sync(['_removeElements', this._cachedMeta.data.length - 1, 1]);\n }\n _onDataShift() {\n this._sync(['_removeElements', 0, 1]);\n }\n _onDataSplice(start, count) {\n if (count) {\n this._sync(['_removeElements', start, count]);\n }\n const newCount = arguments.length - 2;\n if (newCount) {\n this._sync(['_insertElements', start, newCount]);\n }\n }\n _onDataUnshift() {\n this._sync(['_insertElements', 0, arguments.length]);\n }\n}\nDatasetController.defaults = {};\nDatasetController.prototype.datasetElementType = null;\nDatasetController.prototype.dataElementType = null;\n\nfunction getAllScaleValues(scale, type) {\n if (!scale._cache.$bar) {\n const visibleMetas = scale.getMatchingVisibleMetas(type);\n let values = [];\n for (let i = 0, ilen = visibleMetas.length; i < ilen; i++) {\n values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n }\n scale._cache.$bar = _arrayUnique(values.sort((a, b) => a - b));\n }\n return scale._cache.$bar;\n}\nfunction computeMinSampleSize(meta) {\n const scale = meta.iScale;\n const values = getAllScaleValues(scale, meta.type);\n let min = scale._length;\n let i, ilen, curr, prev;\n const updateMinAndPrev = () => {\n if (curr === 32767 || curr === -32768) {\n return;\n }\n if (defined(prev)) {\n min = Math.min(min, Math.abs(curr - prev) || min);\n }\n prev = curr;\n };\n for (i = 0, ilen = values.length; i < ilen; ++i) {\n curr = scale.getPixelForValue(values[i]);\n updateMinAndPrev();\n }\n prev = undefined;\n for (i = 0, ilen = scale.ticks.length; i < ilen; ++i) {\n curr = scale.getPixelForTick(i);\n updateMinAndPrev();\n }\n return min;\n}\nfunction computeFitCategoryTraits(index, ruler, options, stackCount) {\n const thickness = options.barThickness;\n let size, ratio;\n if (isNullOrUndef(thickness)) {\n size = ruler.min * options.categoryPercentage;\n ratio = options.barPercentage;\n } else {\n size = thickness * stackCount;\n ratio = 1;\n }\n return {\n chunk: size / stackCount,\n ratio,\n start: ruler.pixels[index] - (size / 2)\n };\n}\nfunction computeFlexCategoryTraits(index, ruler, options, stackCount) {\n const pixels = ruler.pixels;\n const curr = pixels[index];\n let prev = index > 0 ? pixels[index - 1] : null;\n let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n const percent = options.categoryPercentage;\n if (prev === null) {\n prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n }\n if (next === null) {\n next = curr + curr - prev;\n }\n const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n const size = Math.abs(next - prev) / 2 * percent;\n return {\n chunk: size / stackCount,\n ratio: options.barPercentage,\n start\n };\n}\nfunction parseFloatBar(entry, item, vScale, i) {\n const startValue = vScale.parse(entry[0], i);\n const endValue = vScale.parse(entry[1], i);\n const min = Math.min(startValue, endValue);\n const max = Math.max(startValue, endValue);\n let barStart = min;\n let barEnd = max;\n if (Math.abs(min) > Math.abs(max)) {\n barStart = max;\n barEnd = min;\n }\n item[vScale.axis] = barEnd;\n item._custom = {\n barStart,\n barEnd,\n start: startValue,\n end: endValue,\n min,\n max\n };\n}\nfunction parseValue(entry, item, vScale, i) {\n if (isArray(entry)) {\n parseFloatBar(entry, item, vScale, i);\n } else {\n item[vScale.axis] = vScale.parse(entry, i);\n }\n return item;\n}\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n const iScale = meta.iScale;\n const vScale = meta.vScale;\n const labels = iScale.getLabels();\n const singleScale = iScale === vScale;\n const parsed = [];\n let i, ilen, item, entry;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n entry = data[i];\n item = {};\n item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n parsed.push(parseValue(entry, item, vScale, i));\n }\n return parsed;\n}\nfunction isFloatBar(custom) {\n return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\nfunction barSign(size, vScale, actualBase) {\n if (size !== 0) {\n return sign(size);\n }\n return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\nfunction borderProps(properties) {\n let reverse, start, end, top, bottom;\n if (properties.horizontal) {\n reverse = properties.base > properties.x;\n start = 'left';\n end = 'right';\n } else {\n reverse = properties.base < properties.y;\n start = 'bottom';\n end = 'top';\n }\n if (reverse) {\n top = 'end';\n bottom = 'start';\n } else {\n top = 'start';\n bottom = 'end';\n }\n return {start, end, reverse, top, bottom};\n}\nfunction setBorderSkipped(properties, options, stack, index) {\n let edge = options.borderSkipped;\n const res = {};\n if (!edge) {\n properties.borderSkipped = res;\n return;\n }\n const {start, end, reverse, top, bottom} = borderProps(properties);\n if (edge === 'middle' && stack) {\n properties.enableBorderRadius = true;\n if ((stack._top || 0) === index) {\n edge = top;\n } else if ((stack._bottom || 0) === index) {\n edge = bottom;\n } else {\n res[parseEdge(bottom, start, end, reverse)] = true;\n edge = top;\n }\n }\n res[parseEdge(edge, start, end, reverse)] = true;\n properties.borderSkipped = res;\n}\nfunction parseEdge(edge, a, b, reverse) {\n if (reverse) {\n edge = swap(edge, a, b);\n edge = startEnd(edge, b, a);\n } else {\n edge = startEnd(edge, a, b);\n }\n return edge;\n}\nfunction swap(orig, v1, v2) {\n return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\nfunction startEnd(v, start, end) {\n return v === 'start' ? start : v === 'end' ? end : v;\n}\nfunction setInflateAmount(properties, {inflateAmount}, ratio) {\n properties.inflateAmount = inflateAmount === 'auto'\n ? ratio === 1 ? 0.33 : 0\n : inflateAmount;\n}\nclass BarController extends DatasetController {\n parsePrimitiveData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseArrayData(meta, data, start, count) {\n return parseArrayOrPrimitive(meta, data, start, count);\n }\n parseObjectData(meta, data, start, count) {\n const {iScale, vScale} = meta;\n const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n const parsed = [];\n let i, ilen, item, obj;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n obj = data[i];\n item = {};\n item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n }\n return parsed;\n }\n updateRangeFromParsed(range, scale, parsed, stack) {\n super.updateRangeFromParsed(range, scale, parsed, stack);\n const custom = parsed._custom;\n if (custom && scale === this._cachedMeta.vScale) {\n range.min = Math.min(range.min, custom.min);\n range.max = Math.max(range.max, custom.max);\n }\n }\n getMaxOverflow() {\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const {iScale, vScale} = meta;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const value = isFloatBar(custom)\n ? '[' + custom.start + ', ' + custom.end + ']'\n : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n return {\n label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n value\n };\n }\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n const meta = this._cachedMeta;\n meta.stack = this.getDataset().stack;\n }\n update(mode) {\n const meta = this._cachedMeta;\n this.updateElements(meta.data, 0, meta.data.length, mode);\n }\n updateElements(bars, start, count, mode) {\n const reset = mode === 'reset';\n const {index, _cachedMeta: {vScale}} = this;\n const base = vScale.getBasePixel();\n const horizontal = vScale.isHorizontal();\n const ruler = this._getRuler();\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n for (let i = start; i < start + count; i++) {\n const parsed = this.getParsed(i);\n const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {base, head: base} : this._calculateBarValuePixels(i);\n const ipixels = this._calculateBarIndexPixels(i, ruler);\n const stack = (parsed._stacks || {})[vScale.axis];\n const properties = {\n horizontal,\n base: vpixels.base,\n enableBorderRadius: !stack || isFloatBar(parsed._custom) || (index === stack._top || index === stack._bottom),\n x: horizontal ? vpixels.head : ipixels.center,\n y: horizontal ? ipixels.center : vpixels.head,\n height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n }\n const options = properties.options || bars[i].options;\n setBorderSkipped(properties, options, stack, index);\n setInflateAmount(properties, options, ruler.ratio);\n this.updateElement(bars[i], i, properties, mode);\n }\n }\n _getStacks(last, dataIndex) {\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const metasets = iScale.getMatchingVisibleMetas(this._type);\n const stacked = iScale.options.stacked;\n const ilen = metasets.length;\n const stacks = [];\n let i, item;\n for (i = 0; i < ilen; ++i) {\n item = metasets[i];\n if (!item.controller.options.grouped) {\n continue;\n }\n if (typeof dataIndex !== 'undefined') {\n const val = item.controller.getParsed(dataIndex)[\n item.controller._cachedMeta.vScale.axis\n ];\n if (isNullOrUndef(val) || isNaN(val)) {\n continue;\n }\n }\n if (stacked === false || stacks.indexOf(item.stack) === -1 ||\n\t\t\t\t(stacked === undefined && item.stack === undefined)) {\n stacks.push(item.stack);\n }\n if (item.index === last) {\n break;\n }\n }\n if (!stacks.length) {\n stacks.push(undefined);\n }\n return stacks;\n }\n _getStackCount(index) {\n return this._getStacks(undefined, index).length;\n }\n _getStackIndex(datasetIndex, name, dataIndex) {\n const stacks = this._getStacks(datasetIndex, dataIndex);\n const index = (name !== undefined)\n ? stacks.indexOf(name)\n : -1;\n return (index === -1)\n ? stacks.length - 1\n : index;\n }\n _getRuler() {\n const opts = this.options;\n const meta = this._cachedMeta;\n const iScale = meta.iScale;\n const pixels = [];\n let i, ilen;\n for (i = 0, ilen = meta.data.length; i < ilen; ++i) {\n pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n }\n const barThickness = opts.barThickness;\n const min = barThickness || computeMinSampleSize(meta);\n return {\n min,\n pixels,\n start: iScale._startPixel,\n end: iScale._endPixel,\n stackCount: this._getStackCount(),\n scale: iScale,\n grouped: opts.grouped,\n ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n };\n }\n _calculateBarValuePixels(index) {\n const {_cachedMeta: {vScale, _stacked}, options: {base: baseValue, minBarLength}} = this;\n const actualBase = baseValue || 0;\n const parsed = this.getParsed(index);\n const custom = parsed._custom;\n const floating = isFloatBar(custom);\n let value = parsed[vScale.axis];\n let start = 0;\n let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n let head, size;\n if (length !== value) {\n start = length - value;\n length = value;\n }\n if (floating) {\n value = custom.barStart;\n length = custom.barEnd - custom.barStart;\n if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n start = 0;\n }\n start += value;\n }\n const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n let base = vScale.getPixelForValue(startValue);\n if (this.chart.getDataVisibility(index)) {\n head = vScale.getPixelForValue(start + length);\n } else {\n head = base;\n }\n size = head - base;\n if (Math.abs(size) < minBarLength) {\n size = barSign(size, vScale, actualBase) * minBarLength;\n if (value === actualBase) {\n base -= size / 2;\n }\n head = base + size;\n }\n if (base === vScale.getPixelForValue(actualBase)) {\n const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n base += halfGrid;\n size -= halfGrid;\n }\n return {\n size,\n base,\n head,\n center: head + size / 2\n };\n }\n _calculateBarIndexPixels(index, ruler) {\n const scale = ruler.scale;\n const options = this.options;\n const skipNull = options.skipNull;\n const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n let center, size;\n if (ruler.grouped) {\n const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n const range = options.barThickness === 'flex'\n ? computeFlexCategoryTraits(index, ruler, options, stackCount)\n : computeFitCategoryTraits(index, ruler, options, stackCount);\n const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n center = range.start + (range.chunk * stackIndex) + (range.chunk / 2);\n size = Math.min(maxBarThickness, range.chunk * range.ratio);\n } else {\n center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n }\n return {\n base: center - size / 2,\n head: center + size / 2,\n center,\n size\n };\n }\n draw() {\n const meta = this._cachedMeta;\n const vScale = meta.vScale;\n const rects = meta.data;\n const ilen = rects.length;\n let i = 0;\n for (; i < ilen; ++i) {\n if (this.getParsed(i)[vScale.axis] !== null) {\n rects[i].draw(this._ctx);\n }\n }\n }\n}\nBarController.id = 'bar';\nBarController.defaults = {\n datasetElementType: false,\n dataElementType: 'bar',\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n grouped: true,\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'base', 'width', 'height']\n }\n }\n};\nBarController.overrides = {\n scales: {\n _index_: {\n type: 'category',\n offset: true,\n grid: {\n offset: true\n }\n },\n _value_: {\n type: 'linear',\n beginAtZero: true,\n }\n }\n};\n\nclass BubbleController extends DatasetController {\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n parsePrimitiveData(meta, data, start, count) {\n const parsed = super.parsePrimitiveData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n }\n return parsed;\n }\n parseArrayData(meta, data, start, count) {\n const parsed = super.parseArrayData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n parseObjectData(meta, data, start, count) {\n const parsed = super.parseObjectData(meta, data, start, count);\n for (let i = 0; i < parsed.length; i++) {\n const item = data[start + i];\n parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n }\n return parsed;\n }\n getMaxOverflow() {\n const data = this._cachedMeta.data;\n let max = 0;\n for (let i = data.length - 1; i >= 0; --i) {\n max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n }\n return max > 0 && max;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const {xScale, yScale} = meta;\n const parsed = this.getParsed(index);\n const x = xScale.getLabelForValue(parsed.x);\n const y = yScale.getLabelForValue(parsed.y);\n const r = parsed._custom;\n return {\n label: meta.label,\n value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n };\n }\n update(mode) {\n const points = this._cachedMeta.data;\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale} = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const parsed = !reset && this.getParsed(i);\n const properties = {};\n const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n properties.skip = isNaN(iPixel) || isNaN(vPixel);\n if (includeOptions) {\n properties.options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n if (reset) {\n properties.options.radius = 0;\n }\n }\n this.updateElement(point, i, properties, mode);\n }\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n resolveDataElementOptions(index, mode) {\n const parsed = this.getParsed(index);\n let values = super.resolveDataElementOptions(index, mode);\n if (values.$shared) {\n values = Object.assign({}, values, {$shared: false});\n }\n const radius = values.radius;\n if (mode !== 'active') {\n values.radius = 0;\n }\n values.radius += valueOrDefault(parsed && parsed._custom, radius);\n return values;\n }\n}\nBubbleController.id = 'bubble';\nBubbleController.defaults = {\n datasetElementType: false,\n dataElementType: 'point',\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'borderWidth', 'radius']\n }\n }\n};\nBubbleController.overrides = {\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n },\n plugins: {\n tooltip: {\n callbacks: {\n title() {\n return '';\n }\n }\n }\n }\n};\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n let ratioX = 1;\n let ratioY = 1;\n let offsetX = 0;\n let offsetY = 0;\n if (circumference < TAU) {\n const startAngle = rotation;\n const endAngle = startAngle + circumference;\n const startX = Math.cos(startAngle);\n const startY = Math.sin(startAngle);\n const endX = Math.cos(endAngle);\n const endY = Math.sin(endAngle);\n const calcMax = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n const calcMin = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n const maxX = calcMax(0, startX, endX);\n const maxY = calcMax(HALF_PI, startY, endY);\n const minX = calcMin(PI, startX, endX);\n const minY = calcMin(PI + HALF_PI, startY, endY);\n ratioX = (maxX - minX) / 2;\n ratioY = (maxY - minY) / 2;\n offsetX = -(maxX + minX) / 2;\n offsetY = -(maxY + minY) / 2;\n }\n return {ratioX, ratioY, offsetX, offsetY};\n}\nclass DoughnutController extends DatasetController {\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n this.enableOptionSharing = true;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.offsetX = undefined;\n this.offsetY = undefined;\n }\n linkScales() {}\n parse(start, count) {\n const data = this.getDataset().data;\n const meta = this._cachedMeta;\n if (this._parsing === false) {\n meta._parsed = data;\n } else {\n let getter = (i) => +data[i];\n if (isObject(data[start])) {\n const {key = 'value'} = this._parsing;\n getter = (i) => +resolveObjectKey(data[i], key);\n }\n let i, ilen;\n for (i = start, ilen = start + count; i < ilen; ++i) {\n meta._parsed[i] = getter(i);\n }\n }\n }\n _getRotation() {\n return toRadians(this.options.rotation - 90);\n }\n _getCircumference() {\n return toRadians(this.options.circumference);\n }\n _getRotationExtents() {\n let min = TAU;\n let max = -TAU;\n for (let i = 0; i < this.chart.data.datasets.length; ++i) {\n if (this.chart.isDatasetVisible(i)) {\n const controller = this.chart.getDatasetMeta(i).controller;\n const rotation = controller._getRotation();\n const circumference = controller._getCircumference();\n min = Math.min(min, rotation);\n max = Math.max(max, rotation + circumference);\n }\n }\n return {\n rotation: min,\n circumference: max - min,\n };\n }\n update(mode) {\n const chart = this.chart;\n const {chartArea} = chart;\n const meta = this._cachedMeta;\n const arcs = meta.data;\n const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n const chartWeight = this._getRingWeight(this.index);\n const {circumference, rotation} = this._getRotationExtents();\n const {ratioX, ratioY, offsetX, offsetY} = getRatioAndOffset(rotation, circumference, cutout);\n const maxWidth = (chartArea.width - spacing) / ratioX;\n const maxHeight = (chartArea.height - spacing) / ratioY;\n const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n const outerRadius = toDimension(this.options.radius, maxRadius);\n const innerRadius = Math.max(outerRadius * cutout, 0);\n const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n this.offsetX = offsetX * outerRadius;\n this.offsetY = offsetY * outerRadius;\n meta.total = this.calculateTotal();\n this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n _circumference(i, reset) {\n const opts = this.options;\n const meta = this._cachedMeta;\n const circumference = this._getCircumference();\n if ((reset && opts.animation.animateRotate) || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n return 0;\n }\n return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const animationOpts = opts.animation;\n const centerX = (chartArea.left + chartArea.right) / 2;\n const centerY = (chartArea.top + chartArea.bottom) / 2;\n const animateScale = reset && animationOpts.animateScale;\n const innerRadius = animateScale ? 0 : this.innerRadius;\n const outerRadius = animateScale ? 0 : this.outerRadius;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n let startAngle = this._getRotation();\n let i;\n for (i = 0; i < start; ++i) {\n startAngle += this._circumference(i, reset);\n }\n for (i = start; i < start + count; ++i) {\n const circumference = this._circumference(i, reset);\n const arc = arcs[i];\n const properties = {\n x: centerX + this.offsetX,\n y: centerY + this.offsetY,\n startAngle,\n endAngle: startAngle + circumference,\n circumference,\n outerRadius,\n innerRadius\n };\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n }\n startAngle += circumference;\n this.updateElement(arc, i, properties, mode);\n }\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n calculateTotal() {\n const meta = this._cachedMeta;\n const metaData = meta.data;\n let total = 0;\n let i;\n for (i = 0; i < metaData.length; i++) {\n const value = meta._parsed[i];\n if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n total += Math.abs(value);\n }\n }\n return total;\n }\n calculateCircumference(value) {\n const total = this._cachedMeta.total;\n if (total > 0 && !isNaN(value)) {\n return TAU * (Math.abs(value) / total);\n }\n return 0;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index], chart.options.locale);\n return {\n label: labels[index] || '',\n value,\n };\n }\n getMaxBorderWidth(arcs) {\n let max = 0;\n const chart = this.chart;\n let i, ilen, meta, controller, options;\n if (!arcs) {\n for (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\n if (chart.isDatasetVisible(i)) {\n meta = chart.getDatasetMeta(i);\n arcs = meta.data;\n controller = meta.controller;\n break;\n }\n }\n }\n if (!arcs) {\n return 0;\n }\n for (i = 0, ilen = arcs.length; i < ilen; ++i) {\n options = controller.resolveDataElementOptions(i);\n if (options.borderAlign !== 'inner') {\n max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n }\n }\n return max;\n }\n getMaxOffset(arcs) {\n let max = 0;\n for (let i = 0, ilen = arcs.length; i < ilen; ++i) {\n const options = this.resolveDataElementOptions(i);\n max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n }\n return max;\n }\n _getRingWeightOffset(datasetIndex) {\n let ringWeightOffset = 0;\n for (let i = 0; i < datasetIndex; ++i) {\n if (this.chart.isDatasetVisible(i)) {\n ringWeightOffset += this._getRingWeight(i);\n }\n }\n return ringWeightOffset;\n }\n _getRingWeight(datasetIndex) {\n return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n }\n _getVisibleDatasetWeightTotal() {\n return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n }\n}\nDoughnutController.id = 'doughnut';\nDoughnutController.defaults = {\n datasetElementType: false,\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: false\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['circumference', 'endAngle', 'innerRadius', 'outerRadius', 'startAngle', 'x', 'y', 'offset', 'borderWidth', 'spacing']\n },\n },\n cutout: '50%',\n rotation: 0,\n circumference: 360,\n radius: '100%',\n spacing: 0,\n indexAxis: 'r',\n};\nDoughnutController.descriptors = {\n _scriptable: (name) => name !== 'spacing',\n _indexable: (name) => name !== 'spacing',\n};\nDoughnutController.overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle}} = chart.legend.options;\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n },\n tooltip: {\n callbacks: {\n title() {\n return '';\n },\n label(tooltipItem) {\n let dataLabel = tooltipItem.label;\n const value = ': ' + tooltipItem.formattedValue;\n if (isArray(dataLabel)) {\n dataLabel = dataLabel.slice();\n dataLabel[0] += value;\n } else {\n dataLabel += value;\n }\n return dataLabel;\n }\n }\n }\n }\n};\n\nclass LineController extends DatasetController {\n initialize() {\n this.enableOptionSharing = true;\n super.initialize();\n }\n update(mode) {\n const meta = this._cachedMeta;\n const {dataset: line, data: points = [], _dataset} = meta;\n const animationsDisabled = this.chart._animationsDisabled;\n let {start, count} = getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n this._drawStart = start;\n this._drawCount = count;\n if (scaleRangesChanged(meta)) {\n start = 0;\n count = points.length;\n }\n line._chart = this.chart;\n line._datasetIndex = this.index;\n line._decimated = !!_dataset._decimated;\n line.points = points;\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n options.segment = this.options.segment;\n this.updateElement(line, undefined, {\n animated: !animationsDisabled,\n options\n }, mode);\n this.updateElements(points, start, count, mode);\n }\n updateElements(points, start, count, mode) {\n const reset = mode === 'reset';\n const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n const firstOpts = this.resolveDataElementOptions(start, mode);\n const sharedOptions = this.getSharedOptions(firstOpts);\n const includeOptions = this.includeOptions(mode, sharedOptions);\n const iAxis = iScale.axis;\n const vAxis = vScale.axis;\n const {spanGaps, segment} = this.options;\n const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n let prevParsed = start > 0 && this.getParsed(start - 1);\n for (let i = start; i < start + count; ++i) {\n const point = points[i];\n const parsed = this.getParsed(i);\n const properties = directUpdate ? point : {};\n const nullData = isNullOrUndef(parsed[vAxis]);\n const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n properties.stop = i > 0 && (parsed[iAxis] - prevParsed[iAxis]) > maxGapLength;\n if (segment) {\n properties.parsed = parsed;\n properties.raw = _dataset.data[i];\n }\n if (includeOptions) {\n properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n }\n if (!directUpdate) {\n this.updateElement(point, i, properties, mode);\n }\n prevParsed = parsed;\n }\n this.updateSharedOptions(sharedOptions, mode, firstOpts);\n }\n getMaxOverflow() {\n const meta = this._cachedMeta;\n const dataset = meta.dataset;\n const border = dataset.options && dataset.options.borderWidth || 0;\n const data = meta.data || [];\n if (!data.length) {\n return border;\n }\n const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n return Math.max(border, firstPoint, lastPoint) / 2;\n }\n draw() {\n const meta = this._cachedMeta;\n meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n super.draw();\n }\n}\nLineController.id = 'line';\nLineController.defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n showLine: true,\n spanGaps: false,\n};\nLineController.overrides = {\n scales: {\n _index_: {\n type: 'category',\n },\n _value_: {\n type: 'linear',\n },\n }\n};\nfunction getStartAndCountOfVisiblePoints(meta, points, animationsDisabled) {\n const pointCount = points.length;\n let start = 0;\n let count = pointCount;\n if (meta._sorted) {\n const {iScale, _parsed} = meta;\n const axis = iScale.axis;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(Math.min(\n _lookupByKey(_parsed, iScale.axis, min).lo,\n animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo),\n 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(Math.max(\n _lookupByKey(_parsed, iScale.axis, max).hi + 1,\n animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max)).hi + 1),\n start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n }\n return {start, count};\n}\nfunction scaleRangesChanged(meta) {\n const {xScale, yScale, _scaleRanges} = meta;\n const newRanges = {\n xmin: xScale.min,\n xmax: xScale.max,\n ymin: yScale.min,\n ymax: yScale.max\n };\n if (!_scaleRanges) {\n meta._scaleRanges = newRanges;\n return true;\n }\n const changed = _scaleRanges.xmin !== xScale.min\n\t\t|| _scaleRanges.xmax !== xScale.max\n\t\t|| _scaleRanges.ymin !== yScale.min\n\t\t|| _scaleRanges.ymax !== yScale.max;\n Object.assign(_scaleRanges, newRanges);\n return changed;\n}\n\nclass PolarAreaController extends DatasetController {\n constructor(chart, datasetIndex) {\n super(chart, datasetIndex);\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n }\n getLabelAndValue(index) {\n const meta = this._cachedMeta;\n const chart = this.chart;\n const labels = chart.data.labels || [];\n const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n return {\n label: labels[index] || '',\n value,\n };\n }\n update(mode) {\n const arcs = this._cachedMeta.data;\n this._updateRadius();\n this.updateElements(arcs, 0, arcs.length, mode);\n }\n _updateRadius() {\n const chart = this.chart;\n const chartArea = chart.chartArea;\n const opts = chart.options;\n const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n const outerRadius = Math.max(minSize / 2, 0);\n const innerRadius = Math.max(opts.cutoutPercentage ? (outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\n const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n this.outerRadius = outerRadius - (radiusLength * this.index);\n this.innerRadius = this.outerRadius - radiusLength;\n }\n updateElements(arcs, start, count, mode) {\n const reset = mode === 'reset';\n const chart = this.chart;\n const dataset = this.getDataset();\n const opts = chart.options;\n const animationOpts = opts.animation;\n const scale = this._cachedMeta.rScale;\n const centerX = scale.xCenter;\n const centerY = scale.yCenter;\n const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n let angle = datasetStartAngle;\n let i;\n const defaultAngle = 360 / this.countVisibleElements();\n for (i = 0; i < start; ++i) {\n angle += this._computeAngle(i, mode, defaultAngle);\n }\n for (i = start; i < start + count; i++) {\n const arc = arcs[i];\n let startAngle = angle;\n let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(dataset.data[i]) : 0;\n angle = endAngle;\n if (reset) {\n if (animationOpts.animateScale) {\n outerRadius = 0;\n }\n if (animationOpts.animateRotate) {\n startAngle = endAngle = datasetStartAngle;\n }\n }\n const properties = {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius,\n startAngle,\n endAngle,\n options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n };\n this.updateElement(arc, i, properties, mode);\n }\n }\n countVisibleElements() {\n const dataset = this.getDataset();\n const meta = this._cachedMeta;\n let count = 0;\n meta.data.forEach((element, index) => {\n if (!isNaN(dataset.data[index]) && this.chart.getDataVisibility(index)) {\n count++;\n }\n });\n return count;\n }\n _computeAngle(index, mode, defaultAngle) {\n return this.chart.getDataVisibility(index)\n ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle)\n : 0;\n }\n}\nPolarAreaController.id = 'polarArea';\nPolarAreaController.defaults = {\n dataElementType: 'arc',\n animation: {\n animateRotate: true,\n animateScale: true\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'startAngle', 'endAngle', 'innerRadius', 'outerRadius']\n },\n },\n indexAxis: 'r',\n startAngle: 0,\n};\nPolarAreaController.overrides = {\n aspectRatio: 1,\n plugins: {\n legend: {\n labels: {\n generateLabels(chart) {\n const data = chart.data;\n if (data.labels.length && data.datasets.length) {\n const {labels: {pointStyle}} = chart.legend.options;\n return data.labels.map((label, i) => {\n const meta = chart.getDatasetMeta(0);\n const style = meta.controller.getStyle(i);\n return {\n text: label,\n fillStyle: style.backgroundColor,\n strokeStyle: style.borderColor,\n lineWidth: style.borderWidth,\n pointStyle: pointStyle,\n hidden: !chart.getDataVisibility(i),\n index: i\n };\n });\n }\n return [];\n }\n },\n onClick(e, legendItem, legend) {\n legend.chart.toggleDataVisibility(legendItem.index);\n legend.chart.update();\n }\n },\n tooltip: {\n callbacks: {\n title() {\n return '';\n },\n label(context) {\n return context.chart.data.labels[context.dataIndex] + ': ' + context.formattedValue;\n }\n }\n }\n },\n scales: {\n r: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n beginAtZero: true,\n grid: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n startAngle: 0\n }\n }\n};\n\nclass PieController extends DoughnutController {\n}\nPieController.id = 'pie';\nPieController.defaults = {\n cutout: 0,\n rotation: 0,\n circumference: 360,\n radius: '100%'\n};\n\nclass RadarController extends DatasetController {\n getLabelAndValue(index) {\n const vScale = this._cachedMeta.vScale;\n const parsed = this.getParsed(index);\n return {\n label: vScale.getLabels()[index],\n value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n };\n }\n update(mode) {\n const meta = this._cachedMeta;\n const line = meta.dataset;\n const points = meta.data || [];\n const labels = meta.iScale.getLabels();\n line.points = points;\n if (mode !== 'resize') {\n const options = this.resolveDatasetElementOptions(mode);\n if (!this.options.showLine) {\n options.borderWidth = 0;\n }\n const properties = {\n _loop: true,\n _fullLoop: labels.length === points.length,\n options\n };\n this.updateElement(line, undefined, properties, mode);\n }\n this.updateElements(points, 0, points.length, mode);\n }\n updateElements(points, start, count, mode) {\n const dataset = this.getDataset();\n const scale = this._cachedMeta.rScale;\n const reset = mode === 'reset';\n for (let i = start; i < start + count; i++) {\n const point = points[i];\n const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n const pointPosition = scale.getPointPositionForValue(i, dataset.data[i]);\n const x = reset ? scale.xCenter : pointPosition.x;\n const y = reset ? scale.yCenter : pointPosition.y;\n const properties = {\n x,\n y,\n angle: pointPosition.angle,\n skip: isNaN(x) || isNaN(y),\n options\n };\n this.updateElement(point, i, properties, mode);\n }\n }\n}\nRadarController.id = 'radar';\nRadarController.defaults = {\n datasetElementType: 'line',\n dataElementType: 'point',\n indexAxis: 'r',\n showLine: true,\n elements: {\n line: {\n fill: 'start'\n }\n },\n};\nRadarController.overrides = {\n aspectRatio: 1,\n scales: {\n r: {\n type: 'radialLinear',\n }\n }\n};\n\nclass ScatterController extends LineController {\n}\nScatterController.id = 'scatter';\nScatterController.defaults = {\n showLine: false,\n fill: false\n};\nScatterController.overrides = {\n interaction: {\n mode: 'point'\n },\n plugins: {\n tooltip: {\n callbacks: {\n title() {\n return '';\n },\n label(item) {\n return '(' + item.label + ', ' + item.formattedValue + ')';\n }\n }\n }\n },\n scales: {\n x: {\n type: 'linear'\n },\n y: {\n type: 'linear'\n }\n }\n};\n\nvar controllers = /*#__PURE__*/Object.freeze({\n__proto__: null,\nBarController: BarController,\nBubbleController: BubbleController,\nDoughnutController: DoughnutController,\nLineController: LineController,\nPolarAreaController: PolarAreaController,\nPieController: PieController,\nRadarController: RadarController,\nScatterController: ScatterController\n});\n\nfunction abstract() {\n throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\nclass DateAdapter {\n constructor(options) {\n this.options = options || {};\n }\n formats() {\n return abstract();\n }\n parse(value, format) {\n return abstract();\n }\n format(timestamp, format) {\n return abstract();\n }\n add(timestamp, amount, unit) {\n return abstract();\n }\n diff(a, b, unit) {\n return abstract();\n }\n startOf(timestamp, unit, weekday) {\n return abstract();\n }\n endOf(timestamp, unit) {\n return abstract();\n }\n}\nDateAdapter.override = function(members) {\n Object.assign(DateAdapter.prototype, members);\n};\nvar adapters = {\n _date: DateAdapter\n};\n\nfunction getRelativePosition(e, chart) {\n if ('native' in e) {\n return {\n x: e.x,\n y: e.y\n };\n }\n return getRelativePosition$1(e, chart);\n}\nfunction evaluateAllVisibleItems(chart, handler) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n let index, data, element;\n for (let i = 0, ilen = metasets.length; i < ilen; ++i) {\n ({index, data} = metasets[i]);\n for (let j = 0, jlen = data.length; j < jlen; ++j) {\n element = data[j];\n if (!element.skip) {\n handler(element, index, j);\n }\n }\n }\n}\nfunction binarySearch(metaset, axis, value, intersect) {\n const {controller, data, _sorted} = metaset;\n const iScale = controller._cachedMeta.iScale;\n if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n if (!intersect) {\n return lookupMethod(data, axis, value);\n } else if (controller._sharedOptions) {\n const el = data[0];\n const range = typeof el.getRange === 'function' && el.getRange(axis);\n if (range) {\n const start = lookupMethod(data, axis, value - range);\n const end = lookupMethod(data, axis, value + range);\n return {lo: start.lo, hi: end.hi};\n }\n }\n }\n return {lo: 0, hi: data.length - 1};\n}\nfunction optimizedEvaluateItems(chart, axis, position, handler, intersect) {\n const metasets = chart.getSortedVisibleDatasetMetas();\n const value = position[axis];\n for (let i = 0, ilen = metasets.length; i < ilen; ++i) {\n const {index, data} = metasets[i];\n const {lo, hi} = binarySearch(metasets[i], axis, value, intersect);\n for (let j = lo; j <= hi; ++j) {\n const element = data[j];\n if (!element.skip) {\n handler(element, index, j);\n }\n }\n }\n}\nfunction getDistanceMetricForAxis(axis) {\n const useX = axis.indexOf('x') !== -1;\n const useY = axis.indexOf('y') !== -1;\n return function(pt1, pt2) {\n const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n}\nfunction getIntersectItems(chart, position, axis, useFinalPosition) {\n const items = [];\n if (!_isPointInArea(position, chart.chartArea, chart._minPadding)) {\n return items;\n }\n const evaluationFunc = function(element, datasetIndex, index) {\n if (element.inRange(position.x, position.y, useFinalPosition)) {\n items.push({element, datasetIndex, index});\n }\n };\n optimizedEvaluateItems(chart, axis, position, evaluationFunc, true);\n return items;\n}\nfunction getNearestRadialItems(chart, position, axis, useFinalPosition) {\n let items = [];\n function evaluationFunc(element, datasetIndex, index) {\n const {startAngle, endAngle} = element.getProps(['startAngle', 'endAngle'], useFinalPosition);\n const {angle} = getAngleFromPoint(element, {x: position.x, y: position.y});\n if (_angleBetween(angle, startAngle, endAngle)) {\n items.push({element, datasetIndex, index});\n }\n }\n optimizedEvaluateItems(chart, axis, position, evaluationFunc);\n return items;\n}\nfunction getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition) {\n let items = [];\n const distanceMetric = getDistanceMetricForAxis(axis);\n let minDistance = Number.POSITIVE_INFINITY;\n function evaluationFunc(element, datasetIndex, index) {\n const inRange = element.inRange(position.x, position.y, useFinalPosition);\n if (intersect && !inRange) {\n return;\n }\n const center = element.getCenterPoint(useFinalPosition);\n const pointInArea = _isPointInArea(center, chart.chartArea, chart._minPadding);\n if (!pointInArea && !inRange) {\n return;\n }\n const distance = distanceMetric(position, center);\n if (distance < minDistance) {\n items = [{element, datasetIndex, index}];\n minDistance = distance;\n } else if (distance === minDistance) {\n items.push({element, datasetIndex, index});\n }\n }\n optimizedEvaluateItems(chart, axis, position, evaluationFunc);\n return items;\n}\nfunction getNearestItems(chart, position, axis, intersect, useFinalPosition) {\n if (!_isPointInArea(position, chart.chartArea, chart._minPadding)) {\n return [];\n }\n return axis === 'r' && !intersect\n ? getNearestRadialItems(chart, position, axis, useFinalPosition)\n : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition);\n}\nfunction getAxisItems(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const items = [];\n const axis = options.axis;\n const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n let intersectsItem = false;\n evaluateAllVisibleItems(chart, (element, datasetIndex, index) => {\n if (element[rangeMethod](position[axis], useFinalPosition)) {\n items.push({element, datasetIndex, index});\n }\n if (element.inRange(position.x, position.y, useFinalPosition)) {\n intersectsItem = true;\n }\n });\n if (options.intersect && !intersectsItem) {\n return [];\n }\n return items;\n}\nvar Interaction = {\n modes: {\n index(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'x';\n const items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition)\n : getNearestItems(chart, position, axis, false, useFinalPosition);\n const elements = [];\n if (!items.length) {\n return [];\n }\n chart.getSortedVisibleDatasetMetas().forEach((meta) => {\n const index = items[0].index;\n const element = meta.data[index];\n if (element && !element.skip) {\n elements.push({element, datasetIndex: meta.index, index});\n }\n });\n return elements;\n },\n dataset(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n let items = options.intersect\n ? getIntersectItems(chart, position, axis, useFinalPosition) :\n getNearestItems(chart, position, axis, false, useFinalPosition);\n if (items.length > 0) {\n const datasetIndex = items[0].datasetIndex;\n const data = chart.getDatasetMeta(datasetIndex).data;\n items = [];\n for (let i = 0; i < data.length; ++i) {\n items.push({element: data[i], datasetIndex, index: i});\n }\n }\n return items;\n },\n point(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n return getIntersectItems(chart, position, axis, useFinalPosition);\n },\n nearest(chart, e, options, useFinalPosition) {\n const position = getRelativePosition(e, chart);\n const axis = options.axis || 'xy';\n return getNearestItems(chart, position, axis, options.intersect, useFinalPosition);\n },\n x(chart, e, options, useFinalPosition) {\n return getAxisItems(chart, e, {axis: 'x', intersect: options.intersect}, useFinalPosition);\n },\n y(chart, e, options, useFinalPosition) {\n return getAxisItems(chart, e, {axis: 'y', intersect: options.intersect}, useFinalPosition);\n }\n }\n};\n\nconst STATIC_POSITIONS = ['left', 'top', 'right', 'bottom'];\nfunction filterByPosition(array, position) {\n return array.filter(v => v.pos === position);\n}\nfunction filterDynamicPositionByAxis(array, axis) {\n return array.filter(v => STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\nfunction sortByWeight(array, reverse) {\n return array.sort((a, b) => {\n const v0 = reverse ? b : a;\n const v1 = reverse ? a : b;\n return v0.weight === v1.weight ?\n v0.index - v1.index :\n v0.weight - v1.weight;\n });\n}\nfunction wrapBoxes(boxes) {\n const layoutBoxes = [];\n let i, ilen, box, pos, stack, stackWeight;\n for (i = 0, ilen = (boxes || []).length; i < ilen; ++i) {\n box = boxes[i];\n ({position: pos, options: {stack, stackWeight = 1}} = box);\n layoutBoxes.push({\n index: i,\n box,\n pos,\n horizontal: box.isHorizontal(),\n weight: box.weight,\n stack: stack && (pos + stack),\n stackWeight\n });\n }\n return layoutBoxes;\n}\nfunction buildStacks(layouts) {\n const stacks = {};\n for (const wrap of layouts) {\n const {stack, pos, stackWeight} = wrap;\n if (!stack || !STATIC_POSITIONS.includes(pos)) {\n continue;\n }\n const _stack = stacks[stack] || (stacks[stack] = {count: 0, placed: 0, weight: 0, size: 0});\n _stack.count++;\n _stack.weight += stackWeight;\n }\n return stacks;\n}\nfunction setLayoutDims(layouts, params) {\n const stacks = buildStacks(layouts);\n const {vBoxMaxWidth, hBoxMaxHeight} = params;\n let i, ilen, layout;\n for (i = 0, ilen = layouts.length; i < ilen; ++i) {\n layout = layouts[i];\n const {fullSize} = layout.box;\n const stack = stacks[layout.stack];\n const factor = stack && layout.stackWeight / stack.weight;\n if (layout.horizontal) {\n layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n layout.height = hBoxMaxHeight;\n } else {\n layout.width = vBoxMaxWidth;\n layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n }\n }\n return stacks;\n}\nfunction buildLayoutBoxes(boxes) {\n const layoutBoxes = wrapBoxes(boxes);\n const fullSize = sortByWeight(layoutBoxes.filter(wrap => wrap.box.fullSize), true);\n const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n return {\n fullSize,\n leftAndTop: left.concat(top),\n rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n vertical: left.concat(right).concat(centerVertical),\n horizontal: top.concat(bottom).concat(centerHorizontal)\n };\n}\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\nfunction updateMaxPadding(maxPadding, boxPadding) {\n maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\nfunction updateDims(chartArea, params, layout, stacks) {\n const {pos, box} = layout;\n const maxPadding = chartArea.maxPadding;\n if (!isObject(pos)) {\n if (layout.size) {\n chartArea[pos] -= layout.size;\n }\n const stack = stacks[layout.stack] || {size: 0, count: 1};\n stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n layout.size = stack.size / stack.count;\n chartArea[pos] += layout.size;\n }\n if (box.getPadding) {\n updateMaxPadding(maxPadding, box.getPadding());\n }\n const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n const widthChanged = newWidth !== chartArea.w;\n const heightChanged = newHeight !== chartArea.h;\n chartArea.w = newWidth;\n chartArea.h = newHeight;\n return layout.horizontal\n ? {same: widthChanged, other: heightChanged}\n : {same: heightChanged, other: widthChanged};\n}\nfunction handleMaxPadding(chartArea) {\n const maxPadding = chartArea.maxPadding;\n function updatePos(pos) {\n const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n chartArea[pos] += change;\n return change;\n }\n chartArea.y += updatePos('top');\n chartArea.x += updatePos('left');\n updatePos('right');\n updatePos('bottom');\n}\nfunction getMargins(horizontal, chartArea) {\n const maxPadding = chartArea.maxPadding;\n function marginForPositions(positions) {\n const margin = {left: 0, top: 0, right: 0, bottom: 0};\n positions.forEach((pos) => {\n margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n });\n return margin;\n }\n return horizontal\n ? marginForPositions(['left', 'right'])\n : marginForPositions(['top', 'bottom']);\n}\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n const refitBoxes = [];\n let i, ilen, layout, box, refit, changed;\n for (i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i) {\n layout = boxes[i];\n box = layout.box;\n box.update(\n layout.width || chartArea.w,\n layout.height || chartArea.h,\n getMargins(layout.horizontal, chartArea)\n );\n const {same, other} = updateDims(chartArea, params, layout, stacks);\n refit |= same && refitBoxes.length;\n changed = changed || other;\n if (!box.fullSize) {\n refitBoxes.push(layout);\n }\n }\n return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\nfunction setBoxDims(box, left, top, width, height) {\n box.top = top;\n box.left = left;\n box.right = left + width;\n box.bottom = top + height;\n box.width = width;\n box.height = height;\n}\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n const userPadding = params.padding;\n let {x, y} = chartArea;\n for (const layout of boxes) {\n const box = layout.box;\n const stack = stacks[layout.stack] || {count: 1, placed: 0, weight: 1};\n const weight = (layout.stackWeight / stack.weight) || 1;\n if (layout.horizontal) {\n const width = chartArea.w * weight;\n const height = stack.size || box.height;\n if (defined(stack.start)) {\n y = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n } else {\n setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n }\n stack.start = y;\n stack.placed += width;\n y = box.bottom;\n } else {\n const height = chartArea.h * weight;\n const width = stack.size || box.width;\n if (defined(stack.start)) {\n x = stack.start;\n }\n if (box.fullSize) {\n setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n } else {\n setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n }\n stack.start = x;\n stack.placed += height;\n x = box.right;\n }\n }\n chartArea.x = x;\n chartArea.y = y;\n}\ndefaults.set('layout', {\n autoPadding: true,\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n});\nvar layouts = {\n addBox(chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n item.fullSize = item.fullSize || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n item._layers = item._layers || function() {\n return [{\n z: 0,\n draw(chartArea) {\n item.draw(chartArea);\n }\n }];\n };\n chart.boxes.push(item);\n },\n removeBox(chart, layoutItem) {\n const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n configure(chart, item, options) {\n item.fullSize = options.fullSize;\n item.position = options.position;\n item.weight = options.weight;\n },\n update(chart, width, height, minPadding) {\n if (!chart) {\n return;\n }\n const padding = toPadding(chart.options.layout.padding);\n const availableWidth = Math.max(width - padding.width, 0);\n const availableHeight = Math.max(height - padding.height, 0);\n const boxes = buildLayoutBoxes(chart.boxes);\n const verticalBoxes = boxes.vertical;\n const horizontalBoxes = boxes.horizontal;\n each(chart.boxes, box => {\n if (typeof box.beforeLayout === 'function') {\n box.beforeLayout();\n }\n });\n const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) =>\n wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n const params = Object.freeze({\n outerWidth: width,\n outerHeight: height,\n padding,\n availableWidth,\n availableHeight,\n vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n hBoxMaxHeight: availableHeight / 2\n });\n const maxPadding = Object.assign({}, padding);\n updateMaxPadding(maxPadding, toPadding(minPadding));\n const chartArea = Object.assign({\n maxPadding,\n w: availableWidth,\n h: availableHeight,\n x: padding.left,\n y: padding.top\n }, padding);\n const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n fitBoxes(boxes.fullSize, chartArea, params, stacks);\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n fitBoxes(verticalBoxes, chartArea, params, stacks);\n }\n handleMaxPadding(chartArea);\n placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n chartArea.x += chartArea.w;\n chartArea.y += chartArea.h;\n placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n chart.chartArea = {\n left: chartArea.left,\n top: chartArea.top,\n right: chartArea.left + chartArea.w,\n bottom: chartArea.top + chartArea.h,\n height: chartArea.h,\n width: chartArea.w,\n };\n each(boxes.chartArea, (layout) => {\n const box = layout.box;\n Object.assign(box, chart.chartArea);\n box.update(chartArea.w, chartArea.h, {left: 0, top: 0, right: 0, bottom: 0});\n });\n }\n};\n\nclass BasePlatform {\n acquireContext(canvas, aspectRatio) {}\n releaseContext(context) {\n return false;\n }\n addEventListener(chart, type, listener) {}\n removeEventListener(chart, type, listener) {}\n getDevicePixelRatio() {\n return 1;\n }\n getMaximumSize(element, width, height, aspectRatio) {\n width = Math.max(0, width || element.width);\n height = height || element.height;\n return {\n width,\n height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n };\n }\n isAttached(canvas) {\n return true;\n }\n updateConfig(config) {\n }\n}\n\nclass BasicPlatform extends BasePlatform {\n acquireContext(item) {\n return item && item.getContext && item.getContext('2d') || null;\n }\n updateConfig(config) {\n config.options.animation = false;\n }\n}\n\nconst EXPANDO_KEY = '$chartjs';\nconst EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n};\nconst isNullOrEmpty = value => value === null || value === '';\nfunction initCanvas(canvas, aspectRatio) {\n const style = canvas.style;\n const renderHeight = canvas.getAttribute('height');\n const renderWidth = canvas.getAttribute('width');\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n style.display = style.display || 'block';\n style.boxSizing = style.boxSizing || 'border-box';\n if (isNullOrEmpty(renderWidth)) {\n const displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n if (isNullOrEmpty(renderHeight)) {\n if (canvas.style.height === '') {\n canvas.height = canvas.width / (aspectRatio || 2);\n } else {\n const displayHeight = readUsedSize(canvas, 'height');\n if (displayHeight !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n return canvas;\n}\nconst eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\nfunction addListener(node, type, listener) {\n node.addEventListener(type, listener, eventListenerOptions);\n}\nfunction removeListener(chart, type, listener) {\n chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n}\nfunction fromNativeEvent(event, chart) {\n const type = EVENT_TYPES[event.type] || event.type;\n const {x, y} = getRelativePosition$1(event, chart);\n return {\n type,\n chart,\n native: event,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null,\n };\n}\nfunction nodeListContains(nodeList, canvas) {\n for (const node of nodeList) {\n if (node === canvas || node.contains(canvas)) {\n return true;\n }\n }\n}\nfunction createAttachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\nfunction createDetachObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const observer = new MutationObserver(entries => {\n let trigger = false;\n for (const entry of entries) {\n trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n }\n if (trigger) {\n listener();\n }\n });\n observer.observe(document, {childList: true, subtree: true});\n return observer;\n}\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\nfunction onWindowResize() {\n const dpr = window.devicePixelRatio;\n if (dpr === oldDevicePixelRatio) {\n return;\n }\n oldDevicePixelRatio = dpr;\n drpListeningCharts.forEach((resize, chart) => {\n if (chart.currentDevicePixelRatio !== dpr) {\n resize();\n }\n });\n}\nfunction listenDevicePixelRatioChanges(chart, resize) {\n if (!drpListeningCharts.size) {\n window.addEventListener('resize', onWindowResize);\n }\n drpListeningCharts.set(chart, resize);\n}\nfunction unlistenDevicePixelRatioChanges(chart) {\n drpListeningCharts.delete(chart);\n if (!drpListeningCharts.size) {\n window.removeEventListener('resize', onWindowResize);\n }\n}\nfunction createResizeObserver(chart, type, listener) {\n const canvas = chart.canvas;\n const container = canvas && _getParentNode(canvas);\n if (!container) {\n return;\n }\n const resize = throttled((width, height) => {\n const w = container.clientWidth;\n listener(width, height);\n if (w < container.clientWidth) {\n listener();\n }\n }, window);\n const observer = new ResizeObserver(entries => {\n const entry = entries[0];\n const width = entry.contentRect.width;\n const height = entry.contentRect.height;\n if (width === 0 && height === 0) {\n return;\n }\n resize(width, height);\n });\n observer.observe(container);\n listenDevicePixelRatioChanges(chart, resize);\n return observer;\n}\nfunction releaseObserver(chart, type, observer) {\n if (observer) {\n observer.disconnect();\n }\n if (type === 'resize') {\n unlistenDevicePixelRatioChanges(chart);\n }\n}\nfunction createProxyAndListen(chart, type, listener) {\n const canvas = chart.canvas;\n const proxy = throttled((event) => {\n if (chart.ctx !== null) {\n listener(fromNativeEvent(event, chart));\n }\n }, chart, (args) => {\n const event = args[0];\n return [event, event.offsetX, event.offsetY];\n });\n addListener(canvas, type, proxy);\n return proxy;\n}\nclass DomPlatform extends BasePlatform {\n acquireContext(canvas, aspectRatio) {\n const context = canvas && canvas.getContext && canvas.getContext('2d');\n if (context && context.canvas === canvas) {\n initCanvas(canvas, aspectRatio);\n return context;\n }\n return null;\n }\n releaseContext(context) {\n const canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return false;\n }\n const initial = canvas[EXPANDO_KEY].initial;\n ['height', 'width'].forEach((prop) => {\n const value = initial[prop];\n if (isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n const style = initial.style || {};\n Object.keys(style).forEach((key) => {\n canvas.style[key] = style[key];\n });\n canvas.width = canvas.width;\n delete canvas[EXPANDO_KEY];\n return true;\n }\n addEventListener(chart, type, listener) {\n this.removeEventListener(chart, type);\n const proxies = chart.$proxies || (chart.$proxies = {});\n const handlers = {\n attach: createAttachObserver,\n detach: createDetachObserver,\n resize: createResizeObserver\n };\n const handler = handlers[type] || createProxyAndListen;\n proxies[type] = handler(chart, type, listener);\n }\n removeEventListener(chart, type) {\n const proxies = chart.$proxies || (chart.$proxies = {});\n const proxy = proxies[type];\n if (!proxy) {\n return;\n }\n const handlers = {\n attach: releaseObserver,\n detach: releaseObserver,\n resize: releaseObserver\n };\n const handler = handlers[type] || removeListener;\n handler(chart, type, proxy);\n proxies[type] = undefined;\n }\n getDevicePixelRatio() {\n return window.devicePixelRatio;\n }\n getMaximumSize(canvas, width, height, aspectRatio) {\n return getMaximumSize(canvas, width, height, aspectRatio);\n }\n isAttached(canvas) {\n const container = _getParentNode(canvas);\n return !!(container && container.isConnected);\n }\n}\n\nfunction _detectPlatform(canvas) {\n if (!_isDomSupported() || (typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas)) {\n return BasicPlatform;\n }\n return DomPlatform;\n}\n\nclass Element {\n constructor() {\n this.x = undefined;\n this.y = undefined;\n this.active = false;\n this.options = undefined;\n this.$animations = undefined;\n }\n tooltipPosition(useFinalPosition) {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y};\n }\n hasValue() {\n return isNumber(this.x) && isNumber(this.y);\n }\n getProps(props, final) {\n const anims = this.$animations;\n if (!final || !anims) {\n return this;\n }\n const ret = {};\n props.forEach(prop => {\n ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];\n });\n return ret;\n }\n}\nElement.defaults = {};\nElement.defaultRoutes = undefined;\n\nconst formatters = {\n values(value) {\n return isArray(value) ? value : '' + value;\n },\n numeric(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const locale = this.chart.options.locale;\n let notation;\n let delta = tickValue;\n if (ticks.length > 1) {\n const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n if (maxTick < 1e-4 || maxTick > 1e+15) {\n notation = 'scientific';\n }\n delta = calculateDelta(tickValue, ticks);\n }\n const logDelta = log10(Math.abs(delta));\n const numDecimal = Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n const options = {notation, minimumFractionDigits: numDecimal, maximumFractionDigits: numDecimal};\n Object.assign(options, this.options.ticks.format);\n return formatNumber(tickValue, locale, options);\n },\n logarithmic(tickValue, index, ticks) {\n if (tickValue === 0) {\n return '0';\n }\n const remain = tickValue / (Math.pow(10, Math.floor(log10(tickValue))));\n if (remain === 1 || remain === 2 || remain === 5) {\n return formatters.numeric.call(this, tickValue, index, ticks);\n }\n return '';\n }\n};\nfunction calculateDelta(tickValue, ticks) {\n let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n delta = tickValue - Math.floor(tickValue);\n }\n return delta;\n}\nvar Ticks = {formatters};\n\ndefaults.set('scale', {\n display: true,\n offset: false,\n reverse: false,\n beginAtZero: false,\n bounds: 'ticks',\n grace: 0,\n grid: {\n display: true,\n lineWidth: 1,\n drawBorder: true,\n drawOnChartArea: true,\n drawTicks: true,\n tickLength: 8,\n tickWidth: (_ctx, options) => options.lineWidth,\n tickColor: (_ctx, options) => options.color,\n offset: false,\n borderDash: [],\n borderDashOffset: 0.0,\n borderWidth: 1\n },\n title: {\n display: false,\n text: '',\n padding: {\n top: 4,\n bottom: 4\n }\n },\n ticks: {\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n textStrokeWidth: 0,\n textStrokeColor: '',\n padding: 3,\n display: true,\n autoSkip: true,\n autoSkipPadding: 3,\n labelOffset: 0,\n callback: Ticks.formatters.values,\n minor: {},\n major: {},\n align: 'center',\n crossAlign: 'near',\n showLabelBackdrop: false,\n backdropColor: 'rgba(255, 255, 255, 0.75)',\n backdropPadding: 2,\n }\n});\ndefaults.route('scale.ticks', 'color', '', 'color');\ndefaults.route('scale.grid', 'color', '', 'borderColor');\ndefaults.route('scale.grid', 'borderColor', '', 'borderColor');\ndefaults.route('scale.title', 'color', '', 'color');\ndefaults.describe('scale', {\n _fallback: false,\n _scriptable: (name) => !name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n _indexable: (name) => name !== 'borderDash' && name !== 'tickBorderDash',\n});\ndefaults.describe('scales', {\n _fallback: 'scale',\n});\ndefaults.describe('scale.ticks', {\n _scriptable: (name) => name !== 'backdropPadding' && name !== 'callback',\n _indexable: (name) => name !== 'backdropPadding',\n});\n\nfunction autoSkip(scale, ticks) {\n const tickOpts = scale.options.ticks;\n const ticksLimit = tickOpts.maxTicksLimit || determineMaxTicks(scale);\n const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n const numMajorIndices = majorIndices.length;\n const first = majorIndices[0];\n const last = majorIndices[numMajorIndices - 1];\n const newTicks = [];\n if (numMajorIndices > ticksLimit) {\n skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n return newTicks;\n }\n const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n if (numMajorIndices > 0) {\n let i, ilen;\n const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n for (i = 0, ilen = numMajorIndices - 1; i < ilen; i++) {\n skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n }\n skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n return newTicks;\n }\n skip(ticks, newTicks, spacing);\n return newTicks;\n}\nfunction determineMaxTicks(scale) {\n const offset = scale.options.offset;\n const tickLength = scale._tickSize();\n const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n const maxChart = scale._maxLength / tickLength;\n return Math.floor(Math.min(maxScale, maxChart));\n}\nfunction calculateSpacing(majorIndices, ticks, ticksLimit) {\n const evenMajorSpacing = getEvenSpacing(majorIndices);\n const spacing = ticks.length / ticksLimit;\n if (!evenMajorSpacing) {\n return Math.max(spacing, 1);\n }\n const factors = _factorize(evenMajorSpacing);\n for (let i = 0, ilen = factors.length - 1; i < ilen; i++) {\n const factor = factors[i];\n if (factor > spacing) {\n return factor;\n }\n }\n return Math.max(spacing, 1);\n}\nfunction getMajorIndices(ticks) {\n const result = [];\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (ticks[i].major) {\n result.push(i);\n }\n }\n return result;\n}\nfunction skipMajors(ticks, newTicks, majorIndices, spacing) {\n let count = 0;\n let next = majorIndices[0];\n let i;\n spacing = Math.ceil(spacing);\n for (i = 0; i < ticks.length; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = majorIndices[count * spacing];\n }\n }\n}\nfunction skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n const start = valueOrDefault(majorStart, 0);\n const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n let count = 0;\n let length, i, next;\n spacing = Math.ceil(spacing);\n if (majorEnd) {\n length = majorEnd - majorStart;\n spacing = length / Math.floor(length / spacing);\n }\n next = start;\n while (next < 0) {\n count++;\n next = Math.round(start + count * spacing);\n }\n for (i = Math.max(start, 0); i < end; i++) {\n if (i === next) {\n newTicks.push(ticks[i]);\n count++;\n next = Math.round(start + count * spacing);\n }\n }\n}\nfunction getEvenSpacing(arr) {\n const len = arr.length;\n let i, diff;\n if (len < 2) {\n return false;\n }\n for (diff = arr[0], i = 1; i < len; ++i) {\n if (arr[i] - arr[i - 1] !== diff) {\n return false;\n }\n }\n return diff;\n}\n\nconst reverseAlign = (align) => align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset) => edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\nfunction sample(arr, numItems) {\n const result = [];\n const increment = arr.length / numItems;\n const len = arr.length;\n let i = 0;\n for (; i < len; i += increment) {\n result.push(arr[Math.floor(i)]);\n }\n return result;\n}\nfunction getPixelForGridLine(scale, index, offsetGridLines) {\n const length = scale.ticks.length;\n const validIndex = Math.min(index, length - 1);\n const start = scale._startPixel;\n const end = scale._endPixel;\n const epsilon = 1e-6;\n let lineValue = scale.getPixelForTick(validIndex);\n let offset;\n if (offsetGridLines) {\n if (length === 1) {\n offset = Math.max(lineValue - start, end - lineValue);\n } else if (index === 0) {\n offset = (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n }\n lineValue += validIndex < index ? offset : -offset;\n if (lineValue < start - epsilon || lineValue > end + epsilon) {\n return;\n }\n }\n return lineValue;\n}\nfunction garbageCollect(caches, length) {\n each(caches, (cache) => {\n const gc = cache.gc;\n const gcLen = gc.length / 2;\n let i;\n if (gcLen > length) {\n for (i = 0; i < gcLen; ++i) {\n delete cache.data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n });\n}\nfunction getTickMarkLength(options) {\n return options.drawTicks ? options.tickLength : 0;\n}\nfunction getTitleHeight(options, fallback) {\n if (!options.display) {\n return 0;\n }\n const font = toFont(options.font, fallback);\n const padding = toPadding(options.padding);\n const lines = isArray(options.text) ? options.text.length : 1;\n return (lines * font.lineHeight) + padding.height;\n}\nfunction createScaleContext(parent, scale) {\n return createContext(parent, {\n scale,\n type: 'scale'\n });\n}\nfunction createTickContext(parent, index, tick) {\n return createContext(parent, {\n tick,\n index,\n type: 'tick'\n });\n}\nfunction titleAlign(align, position, reverse) {\n let ret = _toLeftRightCenter(align);\n if ((reverse && position !== 'right') || (!reverse && position === 'right')) {\n ret = reverseAlign(ret);\n }\n return ret;\n}\nfunction titleArgs(scale, offset, position, align) {\n const {top, left, bottom, right, chart} = scale;\n const {chartArea, scales} = chart;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n const height = bottom - top;\n const width = right - left;\n if (scale.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n } else if (position === 'center') {\n titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n } else {\n titleY = offsetFromEdge(scale, position, offset);\n }\n maxWidth = right - left;\n } else {\n if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n } else if (position === 'center') {\n titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n } else {\n titleX = offsetFromEdge(scale, position, offset);\n }\n titleY = _alignStartEnd(align, bottom, top);\n rotation = position === 'left' ? -HALF_PI : HALF_PI;\n }\n return {titleX, titleY, maxWidth, rotation};\n}\nclass Scale extends Element {\n constructor(cfg) {\n super();\n this.id = cfg.id;\n this.type = cfg.type;\n this.options = undefined;\n this.ctx = cfg.ctx;\n this.chart = cfg.chart;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this._margins = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n };\n this.maxWidth = undefined;\n this.maxHeight = undefined;\n this.paddingTop = undefined;\n this.paddingBottom = undefined;\n this.paddingLeft = undefined;\n this.paddingRight = undefined;\n this.axis = undefined;\n this.labelRotation = undefined;\n this.min = undefined;\n this.max = undefined;\n this._range = undefined;\n this.ticks = [];\n this._gridLineItems = null;\n this._labelItems = null;\n this._labelSizes = null;\n this._length = 0;\n this._maxLength = 0;\n this._longestTextCache = {};\n this._startPixel = undefined;\n this._endPixel = undefined;\n this._reversePixels = false;\n this._userMax = undefined;\n this._userMin = undefined;\n this._suggestedMax = undefined;\n this._suggestedMin = undefined;\n this._ticksLength = 0;\n this._borderValue = 0;\n this._cache = {};\n this._dataLimitsCached = false;\n this.$context = undefined;\n }\n init(options) {\n this.options = options.setContext(this.getContext());\n this.axis = options.axis;\n this._userMin = this.parse(options.min);\n this._userMax = this.parse(options.max);\n this._suggestedMin = this.parse(options.suggestedMin);\n this._suggestedMax = this.parse(options.suggestedMax);\n }\n parse(raw, index) {\n return raw;\n }\n getUserBounds() {\n let {_userMin, _userMax, _suggestedMin, _suggestedMax} = this;\n _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n return {\n min: finiteOrDefault(_userMin, _suggestedMin),\n max: finiteOrDefault(_userMax, _suggestedMax),\n minDefined: isNumberFinite(_userMin),\n maxDefined: isNumberFinite(_userMax)\n };\n }\n getMinMax(canStack) {\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n let range;\n if (minDefined && maxDefined) {\n return {min, max};\n }\n const metas = this.getMatchingVisibleMetas();\n for (let i = 0, ilen = metas.length; i < ilen; ++i) {\n range = metas[i].controller.getMinMax(this, canStack);\n if (!minDefined) {\n min = Math.min(min, range.min);\n }\n if (!maxDefined) {\n max = Math.max(max, range.max);\n }\n }\n min = maxDefined && min > max ? max : min;\n max = minDefined && min > max ? min : max;\n return {\n min: finiteOrDefault(min, finiteOrDefault(max, min)),\n max: finiteOrDefault(max, finiteOrDefault(min, max))\n };\n }\n getPadding() {\n return {\n left: this.paddingLeft || 0,\n top: this.paddingTop || 0,\n right: this.paddingRight || 0,\n bottom: this.paddingBottom || 0\n };\n }\n getTicks() {\n return this.ticks;\n }\n getLabels() {\n const data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n }\n beforeLayout() {\n this._cache = {};\n this._dataLimitsCached = false;\n }\n beforeUpdate() {\n callback(this.options.beforeUpdate, [this]);\n }\n update(maxWidth, maxHeight, margins) {\n const {beginAtZero, grace, ticks: tickOpts} = this.options;\n const sampleSize = tickOpts.sampleSize;\n this.beforeUpdate();\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins = Object.assign({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n this.ticks = null;\n this._labelSizes = null;\n this._gridLineItems = null;\n this._labelItems = null;\n this.beforeSetDimensions();\n this.setDimensions();\n this.afterSetDimensions();\n this._maxLength = this.isHorizontal()\n ? this.width + margins.left + margins.right\n : this.height + margins.top + margins.bottom;\n if (!this._dataLimitsCached) {\n this.beforeDataLimits();\n this.determineDataLimits();\n this.afterDataLimits();\n this._range = _addGrace(this, grace, beginAtZero);\n this._dataLimitsCached = true;\n }\n this.beforeBuildTicks();\n this.ticks = this.buildTicks() || [];\n this.afterBuildTicks();\n const samplingEnabled = sampleSize < this.ticks.length;\n this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n this.configure();\n this.beforeCalculateLabelRotation();\n this.calculateLabelRotation();\n this.afterCalculateLabelRotation();\n if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n this.ticks = autoSkip(this, this.ticks);\n this._labelSizes = null;\n }\n if (samplingEnabled) {\n this._convertTicksToLabels(this.ticks);\n }\n this.beforeFit();\n this.fit();\n this.afterFit();\n this.afterUpdate();\n }\n configure() {\n let reversePixels = this.options.reverse;\n let startPixel, endPixel;\n if (this.isHorizontal()) {\n startPixel = this.left;\n endPixel = this.right;\n } else {\n startPixel = this.top;\n endPixel = this.bottom;\n reversePixels = !reversePixels;\n }\n this._startPixel = startPixel;\n this._endPixel = endPixel;\n this._reversePixels = reversePixels;\n this._length = endPixel - startPixel;\n this._alignToPixels = this.options.alignToPixels;\n }\n afterUpdate() {\n callback(this.options.afterUpdate, [this]);\n }\n beforeSetDimensions() {\n callback(this.options.beforeSetDimensions, [this]);\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = 0;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = 0;\n this.bottom = this.height;\n }\n this.paddingLeft = 0;\n this.paddingTop = 0;\n this.paddingRight = 0;\n this.paddingBottom = 0;\n }\n afterSetDimensions() {\n callback(this.options.afterSetDimensions, [this]);\n }\n _callHooks(name) {\n this.chart.notifyPlugins(name, this.getContext());\n callback(this.options[name], [this]);\n }\n beforeDataLimits() {\n this._callHooks('beforeDataLimits');\n }\n determineDataLimits() {}\n afterDataLimits() {\n this._callHooks('afterDataLimits');\n }\n beforeBuildTicks() {\n this._callHooks('beforeBuildTicks');\n }\n buildTicks() {\n return [];\n }\n afterBuildTicks() {\n this._callHooks('afterBuildTicks');\n }\n beforeTickToLabelConversion() {\n callback(this.options.beforeTickToLabelConversion, [this]);\n }\n generateTickLabels(ticks) {\n const tickOpts = this.options.ticks;\n let i, ilen, tick;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n tick = ticks[i];\n tick.label = callback(tickOpts.callback, [tick.value, i, ticks], this);\n }\n }\n afterTickToLabelConversion() {\n callback(this.options.afterTickToLabelConversion, [this]);\n }\n beforeCalculateLabelRotation() {\n callback(this.options.beforeCalculateLabelRotation, [this]);\n }\n calculateLabelRotation() {\n const options = this.options;\n const tickOpts = options.ticks;\n const numTicks = this.ticks.length;\n const minRotation = tickOpts.minRotation || 0;\n const maxRotation = tickOpts.maxRotation;\n let labelRotation = minRotation;\n let tickWidth, maxHeight, maxLabelDiagonal;\n if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n this.labelRotation = minRotation;\n return;\n }\n const labelSizes = this._getLabelSizes();\n const maxLabelWidth = labelSizes.widest.width;\n const maxLabelHeight = labelSizes.highest.height;\n const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n if (maxLabelWidth + 6 > tickWidth) {\n tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n maxHeight = this.maxHeight - getTickMarkLength(options.grid)\n\t\t\t\t- tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n labelRotation = toDegrees(Math.min(\n Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)),\n Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))\n ));\n labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n }\n this.labelRotation = labelRotation;\n }\n afterCalculateLabelRotation() {\n callback(this.options.afterCalculateLabelRotation, [this]);\n }\n beforeFit() {\n callback(this.options.beforeFit, [this]);\n }\n fit() {\n const minSize = {\n width: 0,\n height: 0\n };\n const {chart, options: {ticks: tickOpts, title: titleOpts, grid: gridOpts}} = this;\n const display = this._isVisible();\n const isHorizontal = this.isHorizontal();\n if (display) {\n const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n if (isHorizontal) {\n minSize.width = this.maxWidth;\n minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n } else {\n minSize.height = this.maxHeight;\n minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n }\n if (tickOpts.display && this.ticks.length) {\n const {first, last, widest, highest} = this._getLabelSizes();\n const tickPadding = tickOpts.padding * 2;\n const angleRadians = toRadians(this.labelRotation);\n const cos = Math.cos(angleRadians);\n const sin = Math.sin(angleRadians);\n if (isHorizontal) {\n const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n } else {\n const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n }\n this._calculatePadding(first, last, sin, cos);\n }\n }\n this._handleMargins();\n if (isHorizontal) {\n this.width = this._length = chart.width - this._margins.left - this._margins.right;\n this.height = minSize.height;\n } else {\n this.width = minSize.width;\n this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n }\n }\n _calculatePadding(first, last, sin, cos) {\n const {ticks: {align, padding}, position} = this.options;\n const isRotated = this.labelRotation !== 0;\n const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n if (this.isHorizontal()) {\n const offsetLeft = this.getPixelForTick(0) - this.left;\n const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n let paddingLeft = 0;\n let paddingRight = 0;\n if (isRotated) {\n if (labelsBelowTicks) {\n paddingLeft = cos * first.width;\n paddingRight = sin * last.height;\n } else {\n paddingLeft = sin * first.height;\n paddingRight = cos * last.width;\n }\n } else if (align === 'start') {\n paddingRight = last.width;\n } else if (align === 'end') {\n paddingLeft = first.width;\n } else {\n paddingLeft = first.width / 2;\n paddingRight = last.width / 2;\n }\n this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n } else {\n let paddingTop = last.height / 2;\n let paddingBottom = first.height / 2;\n if (align === 'start') {\n paddingTop = 0;\n paddingBottom = first.height;\n } else if (align === 'end') {\n paddingTop = last.height;\n paddingBottom = 0;\n }\n this.paddingTop = paddingTop + padding;\n this.paddingBottom = paddingBottom + padding;\n }\n }\n _handleMargins() {\n if (this._margins) {\n this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n this._margins.top = Math.max(this.paddingTop, this._margins.top);\n this._margins.right = Math.max(this.paddingRight, this._margins.right);\n this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n }\n }\n afterFit() {\n callback(this.options.afterFit, [this]);\n }\n isHorizontal() {\n const {axis, position} = this.options;\n return position === 'top' || position === 'bottom' || axis === 'x';\n }\n isFullSize() {\n return this.options.fullSize;\n }\n _convertTicksToLabels(ticks) {\n this.beforeTickToLabelConversion();\n this.generateTickLabels(ticks);\n let i, ilen;\n for (i = 0, ilen = ticks.length; i < ilen; i++) {\n if (isNullOrUndef(ticks[i].label)) {\n ticks.splice(i, 1);\n ilen--;\n i--;\n }\n }\n this.afterTickToLabelConversion();\n }\n _getLabelSizes() {\n let labelSizes = this._labelSizes;\n if (!labelSizes) {\n const sampleSize = this.options.ticks.sampleSize;\n let ticks = this.ticks;\n if (sampleSize < ticks.length) {\n ticks = sample(ticks, sampleSize);\n }\n this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length);\n }\n return labelSizes;\n }\n _computeLabelSizes(ticks, length) {\n const {ctx, _longestTextCache: caches} = this;\n const widths = [];\n const heights = [];\n let widestLabelSize = 0;\n let highestLabelSize = 0;\n let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n for (i = 0; i < length; ++i) {\n label = ticks[i].label;\n tickFont = this._resolveTickFontOptions(i);\n ctx.font = fontString = tickFont.string;\n cache = caches[fontString] = caches[fontString] || {data: {}, gc: []};\n lineHeight = tickFont.lineHeight;\n width = height = 0;\n if (!isNullOrUndef(label) && !isArray(label)) {\n width = _measureText(ctx, cache.data, cache.gc, width, label);\n height = lineHeight;\n } else if (isArray(label)) {\n for (j = 0, jlen = label.length; j < jlen; ++j) {\n nestedLabel = label[j];\n if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n height += lineHeight;\n }\n }\n }\n widths.push(width);\n heights.push(height);\n widestLabelSize = Math.max(width, widestLabelSize);\n highestLabelSize = Math.max(height, highestLabelSize);\n }\n garbageCollect(caches, length);\n const widest = widths.indexOf(widestLabelSize);\n const highest = heights.indexOf(highestLabelSize);\n const valueAt = (idx) => ({width: widths[idx] || 0, height: heights[idx] || 0});\n return {\n first: valueAt(0),\n last: valueAt(length - 1),\n widest: valueAt(widest),\n highest: valueAt(highest),\n widths,\n heights,\n };\n }\n getLabelForValue(value) {\n return value;\n }\n getPixelForValue(value, index) {\n return NaN;\n }\n getValueForPixel(pixel) {}\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getPixelForDecimal(decimal) {\n if (this._reversePixels) {\n decimal = 1 - decimal;\n }\n const pixel = this._startPixel + decimal * this._length;\n return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n }\n getDecimalForPixel(pixel) {\n const decimal = (pixel - this._startPixel) / this._length;\n return this._reversePixels ? 1 - decimal : decimal;\n }\n getBasePixel() {\n return this.getPixelForValue(this.getBaseValue());\n }\n getBaseValue() {\n const {min, max} = this;\n return min < 0 && max < 0 ? max :\n min > 0 && max > 0 ? min :\n 0;\n }\n getContext(index) {\n const ticks = this.ticks || [];\n if (index >= 0 && index < ticks.length) {\n const tick = ticks[index];\n return tick.$context ||\n\t\t\t\t(tick.$context = createTickContext(this.getContext(), index, tick));\n }\n return this.$context ||\n\t\t\t(this.$context = createScaleContext(this.chart.getContext(), this));\n }\n _tickSize() {\n const optionTicks = this.options.ticks;\n const rot = toRadians(this.labelRotation);\n const cos = Math.abs(Math.cos(rot));\n const sin = Math.abs(Math.sin(rot));\n const labelSizes = this._getLabelSizes();\n const padding = optionTicks.autoSkipPadding || 0;\n const w = labelSizes ? labelSizes.widest.width + padding : 0;\n const h = labelSizes ? labelSizes.highest.height + padding : 0;\n return this.isHorizontal()\n ? h * cos > w * sin ? w / cos : h / sin\n : h * sin < w * cos ? h / cos : w / sin;\n }\n _isVisible() {\n const display = this.options.display;\n if (display !== 'auto') {\n return !!display;\n }\n return this.getMatchingVisibleMetas().length > 0;\n }\n _computeGridLineItems(chartArea) {\n const axis = this.axis;\n const chart = this.chart;\n const options = this.options;\n const {grid, position} = options;\n const offset = grid.offset;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const ticksLength = ticks.length + (offset ? 1 : 0);\n const tl = getTickMarkLength(grid);\n const items = [];\n const borderOpts = grid.setContext(this.getContext());\n const axisWidth = borderOpts.drawBorder ? borderOpts.borderWidth : 0;\n const axisHalfWidth = axisWidth / 2;\n const alignBorderValue = function(pixel) {\n return _alignPixel(chart, pixel, axisWidth);\n };\n let borderValue, i, lineValue, alignedLineValue;\n let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n if (position === 'top') {\n borderValue = alignBorderValue(this.bottom);\n ty1 = this.bottom - tl;\n ty2 = borderValue - axisHalfWidth;\n y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n y2 = chartArea.bottom;\n } else if (position === 'bottom') {\n borderValue = alignBorderValue(this.top);\n y1 = chartArea.top;\n y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n ty1 = borderValue + axisHalfWidth;\n ty2 = this.top + tl;\n } else if (position === 'left') {\n borderValue = alignBorderValue(this.right);\n tx1 = this.right - tl;\n tx2 = borderValue - axisHalfWidth;\n x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n x2 = chartArea.right;\n } else if (position === 'right') {\n borderValue = alignBorderValue(this.left);\n x1 = chartArea.left;\n x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n tx1 = borderValue + axisHalfWidth;\n tx2 = this.left + tl;\n } else if (axis === 'x') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n ty1 = borderValue + axisHalfWidth;\n ty2 = ty1 + tl;\n } else if (axis === 'y') {\n if (position === 'center') {\n borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n }\n tx1 = borderValue - axisHalfWidth;\n tx2 = tx1 - tl;\n x1 = chartArea.left;\n x2 = chartArea.right;\n }\n const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n const step = Math.max(1, Math.ceil(ticksLength / limit));\n for (i = 0; i < ticksLength; i += step) {\n const optsAtIndex = grid.setContext(this.getContext(i));\n const lineWidth = optsAtIndex.lineWidth;\n const lineColor = optsAtIndex.color;\n const borderDash = grid.borderDash || [];\n const borderDashOffset = optsAtIndex.borderDashOffset;\n const tickWidth = optsAtIndex.tickWidth;\n const tickColor = optsAtIndex.tickColor;\n const tickBorderDash = optsAtIndex.tickBorderDash || [];\n const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n lineValue = getPixelForGridLine(this, i, offset);\n if (lineValue === undefined) {\n continue;\n }\n alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n if (isHorizontal) {\n tx1 = tx2 = x1 = x2 = alignedLineValue;\n } else {\n ty1 = ty2 = y1 = y2 = alignedLineValue;\n }\n items.push({\n tx1,\n ty1,\n tx2,\n ty2,\n x1,\n y1,\n x2,\n y2,\n width: lineWidth,\n color: lineColor,\n borderDash,\n borderDashOffset,\n tickWidth,\n tickColor,\n tickBorderDash,\n tickBorderDashOffset,\n });\n }\n this._ticksLength = ticksLength;\n this._borderValue = borderValue;\n return items;\n }\n _computeLabelItems(chartArea) {\n const axis = this.axis;\n const options = this.options;\n const {position, ticks: optionTicks} = options;\n const isHorizontal = this.isHorizontal();\n const ticks = this.ticks;\n const {align, crossAlign, padding, mirror} = optionTicks;\n const tl = getTickMarkLength(options.grid);\n const tickAndPadding = tl + padding;\n const hTickAndPadding = mirror ? -padding : tickAndPadding;\n const rotation = -toRadians(this.labelRotation);\n const items = [];\n let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n let textBaseline = 'middle';\n if (position === 'top') {\n y = this.bottom - hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'bottom') {\n y = this.top + hTickAndPadding;\n textAlign = this._getXAxisLabelAlignment();\n } else if (position === 'left') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (position === 'right') {\n const ret = this._getYAxisLabelAlignment(tl);\n textAlign = ret.textAlign;\n x = ret.x;\n } else if (axis === 'x') {\n if (position === 'center') {\n y = ((chartArea.top + chartArea.bottom) / 2) + tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n }\n textAlign = this._getXAxisLabelAlignment();\n } else if (axis === 'y') {\n if (position === 'center') {\n x = ((chartArea.left + chartArea.right) / 2) - tickAndPadding;\n } else if (isObject(position)) {\n const positionAxisID = Object.keys(position)[0];\n const value = position[positionAxisID];\n x = this.chart.scales[positionAxisID].getPixelForValue(value);\n }\n textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n }\n if (axis === 'y') {\n if (align === 'start') {\n textBaseline = 'top';\n } else if (align === 'end') {\n textBaseline = 'bottom';\n }\n }\n const labelSizes = this._getLabelSizes();\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n label = tick.label;\n const optsAtIndex = optionTicks.setContext(this.getContext(i));\n pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n font = this._resolveTickFontOptions(i);\n lineHeight = font.lineHeight;\n lineCount = isArray(label) ? label.length : 1;\n const halfCount = lineCount / 2;\n const color = optsAtIndex.color;\n const strokeColor = optsAtIndex.textStrokeColor;\n const strokeWidth = optsAtIndex.textStrokeWidth;\n if (isHorizontal) {\n x = pixel;\n if (position === 'top') {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = -lineCount * lineHeight + lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n } else {\n textOffset = -labelSizes.highest.height + lineHeight / 2;\n }\n } else {\n if (crossAlign === 'near' || rotation !== 0) {\n textOffset = lineHeight / 2;\n } else if (crossAlign === 'center') {\n textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n } else {\n textOffset = labelSizes.highest.height - lineCount * lineHeight;\n }\n }\n if (mirror) {\n textOffset *= -1;\n }\n } else {\n y = pixel;\n textOffset = (1 - lineCount) * lineHeight / 2;\n }\n let backdrop;\n if (optsAtIndex.showLabelBackdrop) {\n const labelPadding = toPadding(optsAtIndex.backdropPadding);\n const height = labelSizes.heights[i];\n const width = labelSizes.widths[i];\n let top = y + textOffset - labelPadding.top;\n let left = x - labelPadding.left;\n switch (textBaseline) {\n case 'middle':\n top -= height / 2;\n break;\n case 'bottom':\n top -= height;\n break;\n }\n switch (textAlign) {\n case 'center':\n left -= width / 2;\n break;\n case 'right':\n left -= width;\n break;\n }\n backdrop = {\n left,\n top,\n width: width + labelPadding.width,\n height: height + labelPadding.height,\n color: optsAtIndex.backdropColor,\n };\n }\n items.push({\n rotation,\n label,\n font,\n color,\n strokeColor,\n strokeWidth,\n textOffset,\n textAlign,\n textBaseline,\n translation: [x, y],\n backdrop,\n });\n }\n return items;\n }\n _getXAxisLabelAlignment() {\n const {position, ticks} = this.options;\n const rotation = -toRadians(this.labelRotation);\n if (rotation) {\n return position === 'top' ? 'left' : 'right';\n }\n let align = 'center';\n if (ticks.align === 'start') {\n align = 'left';\n } else if (ticks.align === 'end') {\n align = 'right';\n }\n return align;\n }\n _getYAxisLabelAlignment(tl) {\n const {position, ticks: {crossAlign, mirror, padding}} = this.options;\n const labelSizes = this._getLabelSizes();\n const tickAndPadding = tl + padding;\n const widest = labelSizes.widest.width;\n let textAlign;\n let x;\n if (position === 'left') {\n if (mirror) {\n x = this.right + padding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += (widest / 2);\n } else {\n textAlign = 'right';\n x += widest;\n }\n } else {\n x = this.right - tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x = this.left;\n }\n }\n } else if (position === 'right') {\n if (mirror) {\n x = this.left + padding;\n if (crossAlign === 'near') {\n textAlign = 'right';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x -= (widest / 2);\n } else {\n textAlign = 'left';\n x -= widest;\n }\n } else {\n x = this.left + tickAndPadding;\n if (crossAlign === 'near') {\n textAlign = 'left';\n } else if (crossAlign === 'center') {\n textAlign = 'center';\n x += widest / 2;\n } else {\n textAlign = 'right';\n x = this.right;\n }\n }\n } else {\n textAlign = 'right';\n }\n return {textAlign, x};\n }\n _computeLabelArea() {\n if (this.options.ticks.mirror) {\n return;\n }\n const chart = this.chart;\n const position = this.options.position;\n if (position === 'left' || position === 'right') {\n return {top: 0, left: this.left, bottom: chart.height, right: this.right};\n } if (position === 'top' || position === 'bottom') {\n return {top: this.top, left: 0, bottom: this.bottom, right: chart.width};\n }\n }\n drawBackground() {\n const {ctx, options: {backgroundColor}, left, top, width, height} = this;\n if (backgroundColor) {\n ctx.save();\n ctx.fillStyle = backgroundColor;\n ctx.fillRect(left, top, width, height);\n ctx.restore();\n }\n }\n getLineWidthForValue(value) {\n const grid = this.options.grid;\n if (!this._isVisible() || !grid.display) {\n return 0;\n }\n const ticks = this.ticks;\n const index = ticks.findIndex(t => t.value === value);\n if (index >= 0) {\n const opts = grid.setContext(this.getContext(index));\n return opts.lineWidth;\n }\n return 0;\n }\n drawGrid(chartArea) {\n const grid = this.options.grid;\n const ctx = this.ctx;\n const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n let i, ilen;\n const drawLine = (p1, p2, style) => {\n if (!style.width || !style.color) {\n return;\n }\n ctx.save();\n ctx.lineWidth = style.width;\n ctx.strokeStyle = style.color;\n ctx.setLineDash(style.borderDash || []);\n ctx.lineDashOffset = style.borderDashOffset;\n ctx.beginPath();\n ctx.moveTo(p1.x, p1.y);\n ctx.lineTo(p2.x, p2.y);\n ctx.stroke();\n ctx.restore();\n };\n if (grid.display) {\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n const item = items[i];\n if (grid.drawOnChartArea) {\n drawLine(\n {x: item.x1, y: item.y1},\n {x: item.x2, y: item.y2},\n item\n );\n }\n if (grid.drawTicks) {\n drawLine(\n {x: item.tx1, y: item.ty1},\n {x: item.tx2, y: item.ty2},\n {\n color: item.tickColor,\n width: item.tickWidth,\n borderDash: item.tickBorderDash,\n borderDashOffset: item.tickBorderDashOffset\n }\n );\n }\n }\n }\n }\n drawBorder() {\n const {chart, ctx, options: {grid}} = this;\n const borderOpts = grid.setContext(this.getContext());\n const axisWidth = grid.drawBorder ? borderOpts.borderWidth : 0;\n if (!axisWidth) {\n return;\n }\n const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n const borderValue = this._borderValue;\n let x1, x2, y1, y2;\n if (this.isHorizontal()) {\n x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n y1 = y2 = borderValue;\n } else {\n y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n x1 = x2 = borderValue;\n }\n ctx.save();\n ctx.lineWidth = borderOpts.borderWidth;\n ctx.strokeStyle = borderOpts.borderColor;\n ctx.beginPath();\n ctx.moveTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.stroke();\n ctx.restore();\n }\n drawLabels(chartArea) {\n const optionTicks = this.options.ticks;\n if (!optionTicks.display) {\n return;\n }\n const ctx = this.ctx;\n const area = this._computeLabelArea();\n if (area) {\n clipArea(ctx, area);\n }\n const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n let i, ilen;\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n const item = items[i];\n const tickFont = item.font;\n const label = item.label;\n if (item.backdrop) {\n ctx.fillStyle = item.backdrop.color;\n ctx.fillRect(item.backdrop.left, item.backdrop.top, item.backdrop.width, item.backdrop.height);\n }\n let y = item.textOffset;\n renderText(ctx, label, 0, y, tickFont, item);\n }\n if (area) {\n unclipArea(ctx);\n }\n }\n drawTitle() {\n const {ctx, options: {position, title, reverse}} = this;\n if (!title.display) {\n return;\n }\n const font = toFont(title.font);\n const padding = toPadding(title.padding);\n const align = title.align;\n let offset = font.lineHeight / 2;\n if (position === 'bottom' || position === 'center' || isObject(position)) {\n offset += padding.bottom;\n if (isArray(title.text)) {\n offset += font.lineHeight * (title.text.length - 1);\n }\n } else {\n offset += padding.top;\n }\n const {titleX, titleY, maxWidth, rotation} = titleArgs(this, offset, position, align);\n renderText(ctx, title.text, 0, 0, font, {\n color: title.color,\n maxWidth,\n rotation,\n textAlign: titleAlign(align, position, reverse),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n draw(chartArea) {\n if (!this._isVisible()) {\n return;\n }\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawBorder();\n this.drawTitle();\n this.drawLabels(chartArea);\n }\n _layers() {\n const opts = this.options;\n const tz = opts.ticks && opts.ticks.z || 0;\n const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n return [{\n z: tz,\n draw: (chartArea) => {\n this.draw(chartArea);\n }\n }];\n }\n return [{\n z: gz,\n draw: (chartArea) => {\n this.drawBackground();\n this.drawGrid(chartArea);\n this.drawTitle();\n }\n }, {\n z: gz + 1,\n draw: () => {\n this.drawBorder();\n }\n }, {\n z: tz,\n draw: (chartArea) => {\n this.drawLabels(chartArea);\n }\n }];\n }\n getMatchingVisibleMetas(type) {\n const metas = this.chart.getSortedVisibleDatasetMetas();\n const axisID = this.axis + 'AxisID';\n const result = [];\n let i, ilen;\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n const meta = metas[i];\n if (meta[axisID] === this.id && (!type || meta.type === type)) {\n result.push(meta);\n }\n }\n return result;\n }\n _resolveTickFontOptions(index) {\n const opts = this.options.ticks.setContext(this.getContext(index));\n return toFont(opts.font);\n }\n _maxDigits() {\n const fontSize = this._resolveTickFontOptions(0).lineHeight;\n return (this.isHorizontal() ? this.width : this.height) / fontSize;\n }\n}\n\nclass TypedRegistry {\n constructor(type, scope, override) {\n this.type = type;\n this.scope = scope;\n this.override = override;\n this.items = Object.create(null);\n }\n isForType(type) {\n return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n }\n register(item) {\n const proto = Object.getPrototypeOf(item);\n let parentScope;\n if (isIChartComponent(proto)) {\n parentScope = this.register(proto);\n }\n const items = this.items;\n const id = item.id;\n const scope = this.scope + '.' + id;\n if (!id) {\n throw new Error('class does not have id: ' + item);\n }\n if (id in items) {\n return scope;\n }\n items[id] = item;\n registerDefaults(item, scope, parentScope);\n if (this.override) {\n defaults.override(item.id, item.overrides);\n }\n return scope;\n }\n get(id) {\n return this.items[id];\n }\n unregister(item) {\n const items = this.items;\n const id = item.id;\n const scope = this.scope;\n if (id in items) {\n delete items[id];\n }\n if (scope && id in defaults[scope]) {\n delete defaults[scope][id];\n if (this.override) {\n delete overrides[id];\n }\n }\n }\n}\nfunction registerDefaults(item, scope, parentScope) {\n const itemDefaults = merge(Object.create(null), [\n parentScope ? defaults.get(parentScope) : {},\n defaults.get(scope),\n item.defaults\n ]);\n defaults.set(scope, itemDefaults);\n if (item.defaultRoutes) {\n routeDefaults(scope, item.defaultRoutes);\n }\n if (item.descriptors) {\n defaults.describe(scope, item.descriptors);\n }\n}\nfunction routeDefaults(scope, routes) {\n Object.keys(routes).forEach(property => {\n const propertyParts = property.split('.');\n const sourceName = propertyParts.pop();\n const sourceScope = [scope].concat(propertyParts).join('.');\n const parts = routes[property].split('.');\n const targetName = parts.pop();\n const targetScope = parts.join('.');\n defaults.route(sourceScope, sourceName, targetScope, targetName);\n });\n}\nfunction isIChartComponent(proto) {\n return 'id' in proto && 'defaults' in proto;\n}\n\nclass Registry {\n constructor() {\n this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n this.elements = new TypedRegistry(Element, 'elements');\n this.plugins = new TypedRegistry(Object, 'plugins');\n this.scales = new TypedRegistry(Scale, 'scales');\n this._typedRegistries = [this.controllers, this.scales, this.elements];\n }\n add(...args) {\n this._each('register', args);\n }\n remove(...args) {\n this._each('unregister', args);\n }\n addControllers(...args) {\n this._each('register', args, this.controllers);\n }\n addElements(...args) {\n this._each('register', args, this.elements);\n }\n addPlugins(...args) {\n this._each('register', args, this.plugins);\n }\n addScales(...args) {\n this._each('register', args, this.scales);\n }\n getController(id) {\n return this._get(id, this.controllers, 'controller');\n }\n getElement(id) {\n return this._get(id, this.elements, 'element');\n }\n getPlugin(id) {\n return this._get(id, this.plugins, 'plugin');\n }\n getScale(id) {\n return this._get(id, this.scales, 'scale');\n }\n removeControllers(...args) {\n this._each('unregister', args, this.controllers);\n }\n removeElements(...args) {\n this._each('unregister', args, this.elements);\n }\n removePlugins(...args) {\n this._each('unregister', args, this.plugins);\n }\n removeScales(...args) {\n this._each('unregister', args, this.scales);\n }\n _each(method, args, typedRegistry) {\n [...args].forEach(arg => {\n const reg = typedRegistry || this._getRegistryForType(arg);\n if (typedRegistry || reg.isForType(arg) || (reg === this.plugins && arg.id)) {\n this._exec(method, reg, arg);\n } else {\n each(arg, item => {\n const itemReg = typedRegistry || this._getRegistryForType(item);\n this._exec(method, itemReg, item);\n });\n }\n });\n }\n _exec(method, registry, component) {\n const camelMethod = _capitalize(method);\n callback(component['before' + camelMethod], [], component);\n registry[method](component);\n callback(component['after' + camelMethod], [], component);\n }\n _getRegistryForType(type) {\n for (let i = 0; i < this._typedRegistries.length; i++) {\n const reg = this._typedRegistries[i];\n if (reg.isForType(type)) {\n return reg;\n }\n }\n return this.plugins;\n }\n _get(id, typedRegistry, type) {\n const item = typedRegistry.get(id);\n if (item === undefined) {\n throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n }\n return item;\n }\n}\nvar registry = new Registry();\n\nclass PluginService {\n constructor() {\n this._init = [];\n }\n notify(chart, hook, args, filter) {\n if (hook === 'beforeInit') {\n this._init = this._createDescriptors(chart, true);\n this._notify(this._init, chart, 'install');\n }\n const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n const result = this._notify(descriptors, chart, hook, args);\n if (hook === 'afterDestroy') {\n this._notify(descriptors, chart, 'stop');\n this._notify(this._init, chart, 'uninstall');\n }\n return result;\n }\n _notify(descriptors, chart, hook, args) {\n args = args || {};\n for (const descriptor of descriptors) {\n const plugin = descriptor.plugin;\n const method = plugin[hook];\n const params = [chart, args, descriptor.options];\n if (callback(method, params, plugin) === false && args.cancelable) {\n return false;\n }\n }\n return true;\n }\n invalidate() {\n if (!isNullOrUndef(this._cache)) {\n this._oldCache = this._cache;\n this._cache = undefined;\n }\n }\n _descriptors(chart) {\n if (this._cache) {\n return this._cache;\n }\n const descriptors = this._cache = this._createDescriptors(chart);\n this._notifyStateChanges(chart);\n return descriptors;\n }\n _createDescriptors(chart, all) {\n const config = chart && chart.config;\n const options = valueOrDefault(config.options && config.options.plugins, {});\n const plugins = allPlugins(config);\n return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n }\n _notifyStateChanges(chart) {\n const previousDescriptors = this._oldCache || [];\n const descriptors = this._cache;\n const diff = (a, b) => a.filter(x => !b.some(y => x.plugin.id === y.plugin.id));\n this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n }\n}\nfunction allPlugins(config) {\n const plugins = [];\n const keys = Object.keys(registry.plugins.items);\n for (let i = 0; i < keys.length; i++) {\n plugins.push(registry.getPlugin(keys[i]));\n }\n const local = config.plugins || [];\n for (let i = 0; i < local.length; i++) {\n const plugin = local[i];\n if (plugins.indexOf(plugin) === -1) {\n plugins.push(plugin);\n }\n }\n return plugins;\n}\nfunction getOpts(options, all) {\n if (!all && options === false) {\n return null;\n }\n if (options === true) {\n return {};\n }\n return options;\n}\nfunction createDescriptors(chart, plugins, options, all) {\n const result = [];\n const context = chart.getContext();\n for (let i = 0; i < plugins.length; i++) {\n const plugin = plugins[i];\n const id = plugin.id;\n const opts = getOpts(options[id], all);\n if (opts === null) {\n continue;\n }\n result.push({\n plugin,\n options: pluginOpts(chart.config, plugin, opts, context)\n });\n }\n return result;\n}\nfunction pluginOpts(config, plugin, opts, context) {\n const keys = config.pluginScopeKeys(plugin);\n const scopes = config.getOptionScopes(opts, keys);\n return config.createResolver(scopes, context, [''], {scriptable: false, indexable: false, allKeys: true});\n}\n\nfunction getIndexAxis(type, options) {\n const datasetDefaults = defaults.datasets[type] || {};\n const datasetOptions = (options.datasets || {})[type] || {};\n return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n let axis = id;\n if (id === '_index_') {\n axis = indexAxis;\n } else if (id === '_value_') {\n axis = indexAxis === 'x' ? 'y' : 'x';\n }\n return axis;\n}\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n return axis === indexAxis ? '_index_' : '_value_';\n}\nfunction axisFromPosition(position) {\n if (position === 'top' || position === 'bottom') {\n return 'x';\n }\n if (position === 'left' || position === 'right') {\n return 'y';\n }\n}\nfunction determineAxis(id, scaleOptions) {\n if (id === 'x' || id === 'y') {\n return id;\n }\n return scaleOptions.axis || axisFromPosition(scaleOptions.position) || id.charAt(0).toLowerCase();\n}\nfunction mergeScaleConfig(config, options) {\n const chartDefaults = overrides[config.type] || {scales: {}};\n const configScales = options.scales || {};\n const chartIndexAxis = getIndexAxis(config.type, options);\n const firstIDs = Object.create(null);\n const scales = Object.create(null);\n Object.keys(configScales).forEach(id => {\n const scaleConf = configScales[id];\n if (!isObject(scaleConf)) {\n return console.error(`Invalid scale configuration for scale: ${id}`);\n }\n if (scaleConf._proxy) {\n return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n }\n const axis = determineAxis(id, scaleConf);\n const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n const defaultScaleOptions = chartDefaults.scales || {};\n firstIDs[axis] = firstIDs[axis] || id;\n scales[id] = mergeIf(Object.create(null), [{axis}, scaleConf, defaultScaleOptions[axis], defaultScaleOptions[defaultId]]);\n });\n config.data.datasets.forEach(dataset => {\n const type = dataset.type || config.type;\n const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n const datasetDefaults = overrides[type] || {};\n const defaultScaleOptions = datasetDefaults.scales || {};\n Object.keys(defaultScaleOptions).forEach(defaultID => {\n const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n const id = dataset[axis + 'AxisID'] || firstIDs[axis] || axis;\n scales[id] = scales[id] || Object.create(null);\n mergeIf(scales[id], [{axis}, configScales[id], defaultScaleOptions[defaultID]]);\n });\n });\n Object.keys(scales).forEach(key => {\n const scale = scales[key];\n mergeIf(scale, [defaults.scales[scale.type], defaults.scale]);\n });\n return scales;\n}\nfunction initOptions(config) {\n const options = config.options || (config.options = {});\n options.plugins = valueOrDefault(options.plugins, {});\n options.scales = mergeScaleConfig(config, options);\n}\nfunction initData(data) {\n data = data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n return data;\n}\nfunction initConfig(config) {\n config = config || {};\n config.data = initData(config.data);\n initOptions(config);\n return config;\n}\nconst keyCache = new Map();\nconst keysCached = new Set();\nfunction cachedKeys(cacheKey, generate) {\n let keys = keyCache.get(cacheKey);\n if (!keys) {\n keys = generate();\n keyCache.set(cacheKey, keys);\n keysCached.add(keys);\n }\n return keys;\n}\nconst addIfFound = (set, obj, key) => {\n const opts = resolveObjectKey(obj, key);\n if (opts !== undefined) {\n set.add(opts);\n }\n};\nclass Config {\n constructor(config) {\n this._config = initConfig(config);\n this._scopeCache = new Map();\n this._resolverCache = new Map();\n }\n get platform() {\n return this._config.platform;\n }\n get type() {\n return this._config.type;\n }\n set type(type) {\n this._config.type = type;\n }\n get data() {\n return this._config.data;\n }\n set data(data) {\n this._config.data = initData(data);\n }\n get options() {\n return this._config.options;\n }\n set options(options) {\n this._config.options = options;\n }\n get plugins() {\n return this._config.plugins;\n }\n update() {\n const config = this._config;\n this.clearCache();\n initOptions(config);\n }\n clearCache() {\n this._scopeCache.clear();\n this._resolverCache.clear();\n }\n datasetScopeKeys(datasetType) {\n return cachedKeys(datasetType,\n () => [[\n `datasets.${datasetType}`,\n ''\n ]]);\n }\n datasetAnimationScopeKeys(datasetType, transition) {\n return cachedKeys(`${datasetType}.transition.${transition}`,\n () => [\n [\n `datasets.${datasetType}.transitions.${transition}`,\n `transitions.${transition}`,\n ],\n [\n `datasets.${datasetType}`,\n ''\n ]\n ]);\n }\n datasetElementScopeKeys(datasetType, elementType) {\n return cachedKeys(`${datasetType}-${elementType}`,\n () => [[\n `datasets.${datasetType}.elements.${elementType}`,\n `datasets.${datasetType}`,\n `elements.${elementType}`,\n ''\n ]]);\n }\n pluginScopeKeys(plugin) {\n const id = plugin.id;\n const type = this.type;\n return cachedKeys(`${type}-plugin-${id}`,\n () => [[\n `plugins.${id}`,\n ...plugin.additionalOptionScopes || [],\n ]]);\n }\n _cachedScopes(mainScope, resetCache) {\n const _scopeCache = this._scopeCache;\n let cache = _scopeCache.get(mainScope);\n if (!cache || resetCache) {\n cache = new Map();\n _scopeCache.set(mainScope, cache);\n }\n return cache;\n }\n getOptionScopes(mainScope, keyLists, resetCache) {\n const {options, type} = this;\n const cache = this._cachedScopes(mainScope, resetCache);\n const cached = cache.get(keyLists);\n if (cached) {\n return cached;\n }\n const scopes = new Set();\n keyLists.forEach(keys => {\n if (mainScope) {\n scopes.add(mainScope);\n keys.forEach(key => addIfFound(scopes, mainScope, key));\n }\n keys.forEach(key => addIfFound(scopes, options, key));\n keys.forEach(key => addIfFound(scopes, overrides[type] || {}, key));\n keys.forEach(key => addIfFound(scopes, defaults, key));\n keys.forEach(key => addIfFound(scopes, descriptors, key));\n });\n const array = Array.from(scopes);\n if (array.length === 0) {\n array.push(Object.create(null));\n }\n if (keysCached.has(keyLists)) {\n cache.set(keyLists, array);\n }\n return array;\n }\n chartOptionScopes() {\n const {options, type} = this;\n return [\n options,\n overrides[type] || {},\n defaults.datasets[type] || {},\n {type},\n defaults,\n descriptors\n ];\n }\n resolveNamedOptions(scopes, names, context, prefixes = ['']) {\n const result = {$shared: true};\n const {resolver, subPrefixes} = getResolver(this._resolverCache, scopes, prefixes);\n let options = resolver;\n if (needContext(resolver, names)) {\n result.$shared = false;\n context = isFunction(context) ? context() : context;\n const subResolver = this.createResolver(scopes, context, subPrefixes);\n options = _attachContext(resolver, context, subResolver);\n }\n for (const prop of names) {\n result[prop] = options[prop];\n }\n return result;\n }\n createResolver(scopes, context, prefixes = [''], descriptorDefaults) {\n const {resolver} = getResolver(this._resolverCache, scopes, prefixes);\n return isObject(context)\n ? _attachContext(resolver, context, undefined, descriptorDefaults)\n : resolver;\n }\n}\nfunction getResolver(resolverCache, scopes, prefixes) {\n let cache = resolverCache.get(scopes);\n if (!cache) {\n cache = new Map();\n resolverCache.set(scopes, cache);\n }\n const cacheKey = prefixes.join();\n let cached = cache.get(cacheKey);\n if (!cached) {\n const resolver = _createResolver(scopes, prefixes);\n cached = {\n resolver,\n subPrefixes: prefixes.filter(p => !p.toLowerCase().includes('hover'))\n };\n cache.set(cacheKey, cached);\n }\n return cached;\n}\nconst hasFunction = value => isObject(value)\n && Object.getOwnPropertyNames(value).reduce((acc, key) => acc || isFunction(value[key]), false);\nfunction needContext(proxy, names) {\n const {isScriptable, isIndexable} = _descriptors(proxy);\n for (const prop of names) {\n const scriptable = isScriptable(prop);\n const indexable = isIndexable(prop);\n const value = (indexable || scriptable) && proxy[prop];\n if ((scriptable && (isFunction(value) || hasFunction(value)))\n || (indexable && isArray(value))) {\n return true;\n }\n }\n return false;\n}\n\nvar version = \"3.7.1\";\n\nconst KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];\nfunction positionIsHorizontal(position, axis) {\n return position === 'top' || position === 'bottom' || (KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x');\n}\nfunction compare2Level(l1, l2) {\n return function(a, b) {\n return a[l1] === b[l1]\n ? a[l2] - b[l2]\n : a[l1] - b[l1];\n };\n}\nfunction onAnimationsComplete(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n chart.notifyPlugins('afterRender');\n callback(animationOptions && animationOptions.onComplete, [context], chart);\n}\nfunction onAnimationProgress(context) {\n const chart = context.chart;\n const animationOptions = chart.options.animation;\n callback(animationOptions && animationOptions.onProgress, [context], chart);\n}\nfunction getCanvas(item) {\n if (_isDomSupported() && typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item && item.length) {\n item = item[0];\n }\n if (item && item.canvas) {\n item = item.canvas;\n }\n return item;\n}\nconst instances = {};\nconst getChart = (key) => {\n const canvas = getCanvas(key);\n return Object.values(instances).filter((c) => c.canvas === canvas).pop();\n};\nfunction moveNumericKeys(obj, start, move) {\n const keys = Object.keys(obj);\n for (const key of keys) {\n const intKey = +key;\n if (intKey >= start) {\n const value = obj[key];\n delete obj[key];\n if (move > 0 || intKey > start) {\n obj[intKey + move] = value;\n }\n }\n }\n}\nfunction determineLastEvent(e, lastEvent, inChartArea, isClick) {\n if (!inChartArea || e.type === 'mouseout') {\n return null;\n }\n if (isClick) {\n return lastEvent;\n }\n return e;\n}\nclass Chart {\n constructor(item, userConfig) {\n const config = this.config = new Config(userConfig);\n const initialCanvas = getCanvas(item);\n const existingChart = getChart(initialCanvas);\n if (existingChart) {\n throw new Error(\n 'Canvas is already in use. Chart with ID \\'' + existingChart.id + '\\'' +\n\t\t\t\t' must be destroyed before the canvas can be reused.'\n );\n }\n const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n this.platform.updateConfig(config);\n const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n const canvas = context && context.canvas;\n const height = canvas && canvas.height;\n const width = canvas && canvas.width;\n this.id = uid();\n this.ctx = context;\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this._options = options;\n this._aspectRatio = this.aspectRatio;\n this._layers = [];\n this._metasets = [];\n this._stacks = undefined;\n this.boxes = [];\n this.currentDevicePixelRatio = undefined;\n this.chartArea = undefined;\n this._active = [];\n this._lastEvent = undefined;\n this._listeners = {};\n this._responsiveListeners = undefined;\n this._sortedMetasets = [];\n this.scales = {};\n this._plugins = new PluginService();\n this.$proxies = {};\n this._hiddenIndices = {};\n this.attached = false;\n this._animationsDisabled = undefined;\n this.$context = undefined;\n this._doResize = debounce(mode => this.update(mode), options.resizeDelay || 0);\n this._dataChanges = [];\n instances[this.id] = this;\n if (!context || !canvas) {\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n animator.listen(this, 'complete', onAnimationsComplete);\n animator.listen(this, 'progress', onAnimationProgress);\n this._initialize();\n if (this.attached) {\n this.update();\n }\n }\n get aspectRatio() {\n const {options: {aspectRatio, maintainAspectRatio}, width, height, _aspectRatio} = this;\n if (!isNullOrUndef(aspectRatio)) {\n return aspectRatio;\n }\n if (maintainAspectRatio && _aspectRatio) {\n return _aspectRatio;\n }\n return height ? width / height : null;\n }\n get data() {\n return this.config.data;\n }\n set data(data) {\n this.config.data = data;\n }\n get options() {\n return this._options;\n }\n set options(options) {\n this.config.options = options;\n }\n _initialize() {\n this.notifyPlugins('beforeInit');\n if (this.options.responsive) {\n this.resize();\n } else {\n retinaScale(this, this.options.devicePixelRatio);\n }\n this.bindEvents();\n this.notifyPlugins('afterInit');\n return this;\n }\n clear() {\n clearCanvas(this.canvas, this.ctx);\n return this;\n }\n stop() {\n animator.stop(this);\n return this;\n }\n resize(width, height) {\n if (!animator.running(this)) {\n this._resize(width, height);\n } else {\n this._resizeBeforeDraw = {width, height};\n }\n }\n _resize(width, height) {\n const options = this.options;\n const canvas = this.canvas;\n const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n const mode = this.width ? 'resize' : 'attach';\n this.width = newSize.width;\n this.height = newSize.height;\n this._aspectRatio = this.aspectRatio;\n if (!retinaScale(this, newRatio, true)) {\n return;\n }\n this.notifyPlugins('resize', {size: newSize});\n callback(options.onResize, [this, newSize], this);\n if (this.attached) {\n if (this._doResize(mode)) {\n this.render();\n }\n }\n }\n ensureScalesHaveIDs() {\n const options = this.options;\n const scalesOptions = options.scales || {};\n each(scalesOptions, (axisOptions, axisID) => {\n axisOptions.id = axisID;\n });\n }\n buildOrUpdateScales() {\n const options = this.options;\n const scaleOpts = options.scales;\n const scales = this.scales;\n const updated = Object.keys(scales).reduce((obj, id) => {\n obj[id] = false;\n return obj;\n }, {});\n let items = [];\n if (scaleOpts) {\n items = items.concat(\n Object.keys(scaleOpts).map((id) => {\n const scaleOptions = scaleOpts[id];\n const axis = determineAxis(id, scaleOptions);\n const isRadial = axis === 'r';\n const isHorizontal = axis === 'x';\n return {\n options: scaleOptions,\n dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n };\n })\n );\n }\n each(items, (item) => {\n const scaleOptions = item.options;\n const id = scaleOptions.id;\n const axis = determineAxis(id, scaleOptions);\n const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n updated[id] = true;\n let scale = null;\n if (id in scales && scales[id].type === scaleType) {\n scale = scales[id];\n } else {\n const scaleClass = registry.getScale(scaleType);\n scale = new scaleClass({\n id,\n type: scaleType,\n ctx: this.ctx,\n chart: this\n });\n scales[scale.id] = scale;\n }\n scale.init(scaleOptions, options);\n });\n each(updated, (hasUpdated, id) => {\n if (!hasUpdated) {\n delete scales[id];\n }\n });\n each(scales, (scale) => {\n layouts.configure(this, scale, scale.options);\n layouts.addBox(this, scale);\n });\n }\n _updateMetasets() {\n const metasets = this._metasets;\n const numData = this.data.datasets.length;\n const numMeta = metasets.length;\n metasets.sort((a, b) => a.index - b.index);\n if (numMeta > numData) {\n for (let i = numData; i < numMeta; ++i) {\n this._destroyDatasetMeta(i);\n }\n metasets.splice(numData, numMeta - numData);\n }\n this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n }\n _removeUnreferencedMetasets() {\n const {_metasets: metasets, data: {datasets}} = this;\n if (metasets.length > datasets.length) {\n delete this._stacks;\n }\n metasets.forEach((meta, index) => {\n if (datasets.filter(x => x === meta._dataset).length === 0) {\n this._destroyDatasetMeta(index);\n }\n });\n }\n buildOrUpdateControllers() {\n const newControllers = [];\n const datasets = this.data.datasets;\n let i, ilen;\n this._removeUnreferencedMetasets();\n for (i = 0, ilen = datasets.length; i < ilen; i++) {\n const dataset = datasets[i];\n let meta = this.getDatasetMeta(i);\n const type = dataset.type || this.config.type;\n if (meta.type && meta.type !== type) {\n this._destroyDatasetMeta(i);\n meta = this.getDatasetMeta(i);\n }\n meta.type = type;\n meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n meta.order = dataset.order || 0;\n meta.index = i;\n meta.label = '' + dataset.label;\n meta.visible = this.isDatasetVisible(i);\n if (meta.controller) {\n meta.controller.updateIndex(i);\n meta.controller.linkScales();\n } else {\n const ControllerClass = registry.getController(type);\n const {datasetElementType, dataElementType} = defaults.datasets[type];\n Object.assign(ControllerClass.prototype, {\n dataElementType: registry.getElement(dataElementType),\n datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n });\n meta.controller = new ControllerClass(this, i);\n newControllers.push(meta.controller);\n }\n }\n this._updateMetasets();\n return newControllers;\n }\n _resetElements() {\n each(this.data.datasets, (dataset, datasetIndex) => {\n this.getDatasetMeta(datasetIndex).controller.reset();\n }, this);\n }\n reset() {\n this._resetElements();\n this.notifyPlugins('reset');\n }\n update(mode) {\n const config = this.config;\n config.update();\n const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n const animsDisabled = this._animationsDisabled = !options.animation;\n this._updateScales();\n this._checkEventBindings();\n this._updateHiddenIndices();\n this._plugins.invalidate();\n if (this.notifyPlugins('beforeUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n const newControllers = this.buildOrUpdateControllers();\n this.notifyPlugins('beforeElementsUpdate');\n let minPadding = 0;\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; i++) {\n const {controller} = this.getDatasetMeta(i);\n const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n controller.buildOrUpdateElements(reset);\n minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n }\n minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n this._updateLayout(minPadding);\n if (!animsDisabled) {\n each(newControllers, (controller) => {\n controller.reset();\n });\n }\n this._updateDatasets(mode);\n this.notifyPlugins('afterUpdate', {mode});\n this._layers.sort(compare2Level('z', '_idx'));\n const {_active, _lastEvent} = this;\n if (_lastEvent) {\n this._eventHandler(_lastEvent, true);\n } else if (_active.length) {\n this._updateHoverStyles(_active, _active, true);\n }\n this.render();\n }\n _updateScales() {\n each(this.scales, (scale) => {\n layouts.removeBox(this, scale);\n });\n this.ensureScalesHaveIDs();\n this.buildOrUpdateScales();\n }\n _checkEventBindings() {\n const options = this.options;\n const existingEvents = new Set(Object.keys(this._listeners));\n const newEvents = new Set(options.events);\n if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n this.unbindEvents();\n this.bindEvents();\n }\n }\n _updateHiddenIndices() {\n const {_hiddenIndices} = this;\n const changes = this._getUniformDataChanges() || [];\n for (const {method, start, count} of changes) {\n const move = method === '_removeElements' ? -count : count;\n moveNumericKeys(_hiddenIndices, start, move);\n }\n }\n _getUniformDataChanges() {\n const _dataChanges = this._dataChanges;\n if (!_dataChanges || !_dataChanges.length) {\n return;\n }\n this._dataChanges = [];\n const datasetCount = this.data.datasets.length;\n const makeSet = (idx) => new Set(\n _dataChanges\n .filter(c => c[0] === idx)\n .map((c, i) => i + ',' + c.splice(1).join(','))\n );\n const changeSet = makeSet(0);\n for (let i = 1; i < datasetCount; i++) {\n if (!setsEqual(changeSet, makeSet(i))) {\n return;\n }\n }\n return Array.from(changeSet)\n .map(c => c.split(','))\n .map(a => ({method: a[1], start: +a[2], count: +a[3]}));\n }\n _updateLayout(minPadding) {\n if (this.notifyPlugins('beforeLayout', {cancelable: true}) === false) {\n return;\n }\n layouts.update(this, this.width, this.height, minPadding);\n const area = this.chartArea;\n const noArea = area.width <= 0 || area.height <= 0;\n this._layers = [];\n each(this.boxes, (box) => {\n if (noArea && box.position === 'chartArea') {\n return;\n }\n if (box.configure) {\n box.configure();\n }\n this._layers.push(...box._layers());\n }, this);\n this._layers.forEach((item, index) => {\n item._idx = index;\n });\n this.notifyPlugins('afterLayout');\n }\n _updateDatasets(mode) {\n if (this.notifyPlugins('beforeDatasetsUpdate', {mode, cancelable: true}) === false) {\n return;\n }\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this.getDatasetMeta(i).controller.configure();\n }\n for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._updateDataset(i, isFunction(mode) ? mode({datasetIndex: i}) : mode);\n }\n this.notifyPlugins('afterDatasetsUpdate', {mode});\n }\n _updateDataset(index, mode) {\n const meta = this.getDatasetMeta(index);\n const args = {meta, index, mode, cancelable: true};\n if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n return;\n }\n meta.controller._update(mode);\n args.cancelable = false;\n this.notifyPlugins('afterDatasetUpdate', args);\n }\n render() {\n if (this.notifyPlugins('beforeRender', {cancelable: true}) === false) {\n return;\n }\n if (animator.has(this)) {\n if (this.attached && !animator.running(this)) {\n animator.start(this);\n }\n } else {\n this.draw();\n onAnimationsComplete({chart: this});\n }\n }\n draw() {\n let i;\n if (this._resizeBeforeDraw) {\n const {width, height} = this._resizeBeforeDraw;\n this._resize(width, height);\n this._resizeBeforeDraw = null;\n }\n this.clear();\n if (this.width <= 0 || this.height <= 0) {\n return;\n }\n if (this.notifyPlugins('beforeDraw', {cancelable: true}) === false) {\n return;\n }\n const layers = this._layers;\n for (i = 0; i < layers.length && layers[i].z <= 0; ++i) {\n layers[i].draw(this.chartArea);\n }\n this._drawDatasets();\n for (; i < layers.length; ++i) {\n layers[i].draw(this.chartArea);\n }\n this.notifyPlugins('afterDraw');\n }\n _getSortedDatasetMetas(filterVisible) {\n const metasets = this._sortedMetasets;\n const result = [];\n let i, ilen;\n for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n const meta = metasets[i];\n if (!filterVisible || meta.visible) {\n result.push(meta);\n }\n }\n return result;\n }\n getSortedVisibleDatasetMetas() {\n return this._getSortedDatasetMetas(true);\n }\n _drawDatasets() {\n if (this.notifyPlugins('beforeDatasetsDraw', {cancelable: true}) === false) {\n return;\n }\n const metasets = this.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n this._drawDataset(metasets[i]);\n }\n this.notifyPlugins('afterDatasetsDraw');\n }\n _drawDataset(meta) {\n const ctx = this.ctx;\n const clip = meta._clip;\n const useClip = !clip.disabled;\n const area = this.chartArea;\n const args = {\n meta,\n index: meta.index,\n cancelable: true\n };\n if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n return;\n }\n if (useClip) {\n clipArea(ctx, {\n left: clip.left === false ? 0 : area.left - clip.left,\n right: clip.right === false ? this.width : area.right + clip.right,\n top: clip.top === false ? 0 : area.top - clip.top,\n bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n });\n }\n meta.controller.draw();\n if (useClip) {\n unclipArea(ctx);\n }\n args.cancelable = false;\n this.notifyPlugins('afterDatasetDraw', args);\n }\n getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n const method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options, useFinalPosition);\n }\n return [];\n }\n getDatasetMeta(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n const metasets = this._metasets;\n let meta = metasets.filter(x => x && x._dataset === dataset).pop();\n if (!meta) {\n meta = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\n xAxisID: null,\n yAxisID: null,\n order: dataset && dataset.order || 0,\n index: datasetIndex,\n _dataset: dataset,\n _parsed: [],\n _sorted: false\n };\n metasets.push(meta);\n }\n return meta;\n }\n getContext() {\n return this.$context || (this.$context = createContext(null, {chart: this, type: 'chart'}));\n }\n getVisibleDatasetCount() {\n return this.getSortedVisibleDatasetMetas().length;\n }\n isDatasetVisible(datasetIndex) {\n const dataset = this.data.datasets[datasetIndex];\n if (!dataset) {\n return false;\n }\n const meta = this.getDatasetMeta(datasetIndex);\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n }\n setDatasetVisibility(datasetIndex, visible) {\n const meta = this.getDatasetMeta(datasetIndex);\n meta.hidden = !visible;\n }\n toggleDataVisibility(index) {\n this._hiddenIndices[index] = !this._hiddenIndices[index];\n }\n getDataVisibility(index) {\n return !this._hiddenIndices[index];\n }\n _updateVisibility(datasetIndex, dataIndex, visible) {\n const mode = visible ? 'show' : 'hide';\n const meta = this.getDatasetMeta(datasetIndex);\n const anims = meta.controller._resolveAnimations(undefined, mode);\n if (defined(dataIndex)) {\n meta.data[dataIndex].hidden = !visible;\n this.update();\n } else {\n this.setDatasetVisibility(datasetIndex, visible);\n anims.update(meta, {visible});\n this.update((ctx) => ctx.datasetIndex === datasetIndex ? mode : undefined);\n }\n }\n hide(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, false);\n }\n show(datasetIndex, dataIndex) {\n this._updateVisibility(datasetIndex, dataIndex, true);\n }\n _destroyDatasetMeta(datasetIndex) {\n const meta = this._metasets[datasetIndex];\n if (meta && meta.controller) {\n meta.controller._destroy();\n }\n delete this._metasets[datasetIndex];\n }\n _stop() {\n let i, ilen;\n this.stop();\n animator.remove(this);\n for (i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n this._destroyDatasetMeta(i);\n }\n }\n destroy() {\n this.notifyPlugins('beforeDestroy');\n const {canvas, ctx} = this;\n this._stop();\n this.config.clearCache();\n if (canvas) {\n this.unbindEvents();\n clearCanvas(canvas, ctx);\n this.platform.releaseContext(ctx);\n this.canvas = null;\n this.ctx = null;\n }\n this.notifyPlugins('destroy');\n delete instances[this.id];\n this.notifyPlugins('afterDestroy');\n }\n toBase64Image(...args) {\n return this.canvas.toDataURL(...args);\n }\n bindEvents() {\n this.bindUserEvents();\n if (this.options.responsive) {\n this.bindResponsiveEvents();\n } else {\n this.attached = true;\n }\n }\n bindUserEvents() {\n const listeners = this._listeners;\n const platform = this.platform;\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const listener = (e, x, y) => {\n e.offsetX = x;\n e.offsetY = y;\n this._eventHandler(e);\n };\n each(this.options.events, (type) => _add(type, listener));\n }\n bindResponsiveEvents() {\n if (!this._responsiveListeners) {\n this._responsiveListeners = {};\n }\n const listeners = this._responsiveListeners;\n const platform = this.platform;\n const _add = (type, listener) => {\n platform.addEventListener(this, type, listener);\n listeners[type] = listener;\n };\n const _remove = (type, listener) => {\n if (listeners[type]) {\n platform.removeEventListener(this, type, listener);\n delete listeners[type];\n }\n };\n const listener = (width, height) => {\n if (this.canvas) {\n this.resize(width, height);\n }\n };\n let detached;\n const attached = () => {\n _remove('attach', attached);\n this.attached = true;\n this.resize();\n _add('resize', listener);\n _add('detach', detached);\n };\n detached = () => {\n this.attached = false;\n _remove('resize', listener);\n this._stop();\n this._resize(0, 0);\n _add('attach', attached);\n };\n if (platform.isAttached(this.canvas)) {\n attached();\n } else {\n detached();\n }\n }\n unbindEvents() {\n each(this._listeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._listeners = {};\n each(this._responsiveListeners, (listener, type) => {\n this.platform.removeEventListener(this, type, listener);\n });\n this._responsiveListeners = undefined;\n }\n updateHoverStyle(items, mode, enabled) {\n const prefix = enabled ? 'set' : 'remove';\n let meta, item, i, ilen;\n if (mode === 'dataset') {\n meta = this.getDatasetMeta(items[0].datasetIndex);\n meta.controller['_' + prefix + 'DatasetHoverStyle']();\n }\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n item = items[i];\n const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n if (controller) {\n controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n }\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements) {\n const lastActive = this._active || [];\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('No dataset found at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(active, lastActive);\n if (changed) {\n this._active = active;\n this._lastEvent = null;\n this._updateHoverStyles(active, lastActive);\n }\n }\n notifyPlugins(hook, args, filter) {\n return this._plugins.notify(this, hook, args, filter);\n }\n _updateHoverStyles(active, lastActive, replay) {\n const hoverOptions = this.options.hover;\n const diff = (a, b) => a.filter(x => !b.some(y => x.datasetIndex === y.datasetIndex && x.index === y.index));\n const deactivated = diff(lastActive, active);\n const activated = replay ? active : diff(active, lastActive);\n if (deactivated.length) {\n this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n }\n if (activated.length && hoverOptions.mode) {\n this.updateHoverStyle(activated, hoverOptions.mode, true);\n }\n }\n _eventHandler(e, replay) {\n const args = {\n event: e,\n replay,\n cancelable: true,\n inChartArea: _isPointInArea(e, this.chartArea, this._minPadding)\n };\n const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e.native.type);\n if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n return;\n }\n const changed = this._handleEvent(e, replay, args.inChartArea);\n args.cancelable = false;\n this.notifyPlugins('afterEvent', args, eventFilter);\n if (changed || args.changed) {\n this.render();\n }\n return this;\n }\n _handleEvent(e, replay, inChartArea) {\n const {_active: lastActive = [], options} = this;\n const useFinalPosition = replay;\n const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n const isClick = _isClickEvent(e);\n const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n if (inChartArea) {\n this._lastEvent = null;\n callback(options.onHover, [e, active, this], this);\n if (isClick) {\n callback(options.onClick, [e, active, this], this);\n }\n }\n const changed = !_elementsEqual(active, lastActive);\n if (changed || replay) {\n this._active = active;\n this._updateHoverStyles(active, lastActive, replay);\n }\n this._lastEvent = lastEvent;\n return changed;\n }\n _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const hoverOptions = this.options.hover;\n return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n }\n}\nconst invalidatePlugins = () => each(Chart.instances, (chart) => chart._plugins.invalidate());\nconst enumerable = true;\nObject.defineProperties(Chart, {\n defaults: {\n enumerable,\n value: defaults\n },\n instances: {\n enumerable,\n value: instances\n },\n overrides: {\n enumerable,\n value: overrides\n },\n registry: {\n enumerable,\n value: registry\n },\n version: {\n enumerable,\n value: version\n },\n getChart: {\n enumerable,\n value: getChart\n },\n register: {\n enumerable,\n value: (...items) => {\n registry.add(...items);\n invalidatePlugins();\n }\n },\n unregister: {\n enumerable,\n value: (...items) => {\n registry.remove(...items);\n invalidatePlugins();\n }\n }\n});\n\nfunction clipArc(ctx, element, endAngle) {\n const {startAngle, pixelMargin, x, y, outerRadius, innerRadius} = element;\n let angleMargin = pixelMargin / outerRadius;\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n if (innerRadius > pixelMargin) {\n angleMargin = pixelMargin / innerRadius;\n ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n } else {\n ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n }\n ctx.closePath();\n ctx.clip();\n}\nfunction toRadiusCorners(value) {\n return _readValueToProps(value, ['outerStart', 'outerEnd', 'innerStart', 'innerEnd']);\n}\nfunction parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) {\n const o = toRadiusCorners(arc.options.borderRadius);\n const halfThickness = (outerRadius - innerRadius) / 2;\n const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n const computeOuterLimit = (val) => {\n const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n };\n return {\n outerStart: computeOuterLimit(o.outerStart),\n outerEnd: computeOuterLimit(o.outerEnd),\n innerStart: _limitValue(o.innerStart, 0, innerLimit),\n innerEnd: _limitValue(o.innerEnd, 0, innerLimit),\n };\n}\nfunction rThetaToXY(r, theta, x, y) {\n return {\n x: x + r * Math.cos(theta),\n y: y + r * Math.sin(theta),\n };\n}\nfunction pathArc(ctx, element, offset, spacing, end) {\n const {x, y, startAngle: start, pixelMargin, innerRadius: innerR} = element;\n const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n let spacingOffset = 0;\n const alpha = end - start;\n if (spacing) {\n const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n const adjustedAngle = avNogSpacingRadius !== 0 ? (alpha * avNogSpacingRadius) / (avNogSpacingRadius + spacing) : alpha;\n spacingOffset = (alpha - adjustedAngle) / 2;\n }\n const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n const angleOffset = (alpha - beta) / 2;\n const startAngle = start + angleOffset + spacingOffset;\n const endAngle = end - angleOffset - spacingOffset;\n const {outerStart, outerEnd, innerStart, innerEnd} = parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle);\n const outerStartAdjustedRadius = outerRadius - outerStart;\n const outerEndAdjustedRadius = outerRadius - outerEnd;\n const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n const innerStartAdjustedRadius = innerRadius + innerStart;\n const innerEndAdjustedRadius = innerRadius + innerEnd;\n const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerEndAdjustedAngle);\n if (outerEnd > 0) {\n const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n }\n const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n ctx.lineTo(p4.x, p4.y);\n if (innerEnd > 0) {\n const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n }\n ctx.arc(x, y, innerRadius, endAngle - (innerEnd / innerRadius), startAngle + (innerStart / innerRadius), true);\n if (innerStart > 0) {\n const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n }\n const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n ctx.lineTo(p8.x, p8.y);\n if (outerStart > 0) {\n const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n }\n ctx.closePath();\n}\nfunction drawArc(ctx, element, offset, spacing) {\n const {fullCircles, startAngle, circumference} = element;\n let endAngle = element.endAngle;\n if (fullCircles) {\n pathArc(ctx, element, offset, spacing, startAngle + TAU);\n for (let i = 0; i < fullCircles; ++i) {\n ctx.fill();\n }\n if (!isNaN(circumference)) {\n endAngle = startAngle + circumference % TAU;\n if (circumference % TAU === 0) {\n endAngle += TAU;\n }\n }\n }\n pathArc(ctx, element, offset, spacing, endAngle);\n ctx.fill();\n return endAngle;\n}\nfunction drawFullCircleBorders(ctx, element, inner) {\n const {x, y, startAngle, pixelMargin, fullCircles} = element;\n const outerRadius = Math.max(element.outerRadius - pixelMargin, 0);\n const innerRadius = element.innerRadius + pixelMargin;\n let i;\n if (inner) {\n clipArc(ctx, element, startAngle + TAU);\n }\n ctx.beginPath();\n ctx.arc(x, y, innerRadius, startAngle + TAU, startAngle, true);\n for (i = 0; i < fullCircles; ++i) {\n ctx.stroke();\n }\n ctx.beginPath();\n ctx.arc(x, y, outerRadius, startAngle, startAngle + TAU);\n for (i = 0; i < fullCircles; ++i) {\n ctx.stroke();\n }\n}\nfunction drawBorder(ctx, element, offset, spacing, endAngle) {\n const {options} = element;\n const {borderWidth, borderJoinStyle} = options;\n const inner = options.borderAlign === 'inner';\n if (!borderWidth) {\n return;\n }\n if (inner) {\n ctx.lineWidth = borderWidth * 2;\n ctx.lineJoin = borderJoinStyle || 'round';\n } else {\n ctx.lineWidth = borderWidth;\n ctx.lineJoin = borderJoinStyle || 'bevel';\n }\n if (element.fullCircles) {\n drawFullCircleBorders(ctx, element, inner);\n }\n if (inner) {\n clipArc(ctx, element, endAngle);\n }\n pathArc(ctx, element, offset, spacing, endAngle);\n ctx.stroke();\n}\nclass ArcElement extends Element {\n constructor(cfg) {\n super();\n this.options = undefined;\n this.circumference = undefined;\n this.startAngle = undefined;\n this.endAngle = undefined;\n this.innerRadius = undefined;\n this.outerRadius = undefined;\n this.pixelMargin = 0;\n this.fullCircles = 0;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(chartX, chartY, useFinalPosition) {\n const point = this.getProps(['x', 'y'], useFinalPosition);\n const {angle, distance} = getAngleFromPoint(point, {x: chartX, y: chartY});\n const {startAngle, endAngle, innerRadius, outerRadius, circumference} = this.getProps([\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference'\n ], useFinalPosition);\n const rAdjust = this.options.spacing / 2;\n const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n const betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);\n const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n return (betweenAngles && withinRadius);\n }\n getCenterPoint(useFinalPosition) {\n const {x, y, startAngle, endAngle, innerRadius, outerRadius} = this.getProps([\n 'x',\n 'y',\n 'startAngle',\n 'endAngle',\n 'innerRadius',\n 'outerRadius',\n 'circumference',\n ], useFinalPosition);\n const {offset, spacing} = this.options;\n const halfAngle = (startAngle + endAngle) / 2;\n const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n return {\n x: x + Math.cos(halfAngle) * halfRadius,\n y: y + Math.sin(halfAngle) * halfRadius\n };\n }\n tooltipPosition(useFinalPosition) {\n return this.getCenterPoint(useFinalPosition);\n }\n draw(ctx) {\n const {options, circumference} = this;\n const offset = (options.offset || 0) / 2;\n const spacing = (options.spacing || 0) / 2;\n this.pixelMargin = (options.borderAlign === 'inner') ? 0.33 : 0;\n this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n return;\n }\n ctx.save();\n let radiusOffset = 0;\n if (offset) {\n radiusOffset = offset / 2;\n const halfAngle = (this.startAngle + this.endAngle) / 2;\n ctx.translate(Math.cos(halfAngle) * radiusOffset, Math.sin(halfAngle) * radiusOffset);\n if (this.circumference >= PI) {\n radiusOffset = offset;\n }\n }\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n const endAngle = drawArc(ctx, this, radiusOffset, spacing);\n drawBorder(ctx, this, radiusOffset, spacing, endAngle);\n ctx.restore();\n }\n}\nArcElement.id = 'arc';\nArcElement.defaults = {\n borderAlign: 'center',\n borderColor: '#fff',\n borderJoinStyle: undefined,\n borderRadius: 0,\n borderWidth: 2,\n offset: 0,\n spacing: 0,\n angle: undefined,\n};\nArcElement.defaultRoutes = {\n backgroundColor: 'backgroundColor'\n};\n\nfunction setStyle(ctx, options, style = options) {\n ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\nfunction lineTo(ctx, previous, target) {\n ctx.lineTo(target.x, target.y);\n}\nfunction getLineMethod(options) {\n if (options.stepped) {\n return _steppedLineTo;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierCurveTo;\n }\n return lineTo;\n}\nfunction pathVars(points, segment, params = {}) {\n const count = points.length;\n const {start: paramsStart = 0, end: paramsEnd = count - 1} = params;\n const {start: segmentStart, end: segmentEnd} = segment;\n const start = Math.max(paramsStart, segmentStart);\n const end = Math.min(paramsEnd, segmentEnd);\n const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n return {\n count,\n start,\n loop: segment.loop,\n ilen: end < start && !outside ? count + end - start : end - start\n };\n}\nfunction pathSegment(ctx, line, segment, params) {\n const {points, options} = line;\n const {count, start, loop, ilen} = pathVars(points, segment, params);\n const lineMethod = getLineMethod(options);\n let {move = true, reverse} = params || {};\n let i, point, prev;\n for (i = 0; i <= ilen; ++i) {\n point = points[(start + (reverse ? ilen - i : i)) % count];\n if (point.skip) {\n continue;\n } else if (move) {\n ctx.moveTo(point.x, point.y);\n move = false;\n } else {\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n prev = point;\n }\n if (loop) {\n point = points[(start + (reverse ? ilen : 0)) % count];\n lineMethod(ctx, prev, point, reverse, options.stepped);\n }\n return !!loop;\n}\nfunction fastPathSegment(ctx, line, segment, params) {\n const points = line.points;\n const {count, start, ilen} = pathVars(points, segment, params);\n const {move = true, reverse} = params || {};\n let avgX = 0;\n let countX = 0;\n let i, point, prevX, minY, maxY, lastY;\n const pointIndex = (index) => (start + (reverse ? ilen - index : index)) % count;\n const drawX = () => {\n if (minY !== maxY) {\n ctx.lineTo(avgX, maxY);\n ctx.lineTo(avgX, minY);\n ctx.lineTo(avgX, lastY);\n }\n };\n if (move) {\n point = points[pointIndex(0)];\n ctx.moveTo(point.x, point.y);\n }\n for (i = 0; i <= ilen; ++i) {\n point = points[pointIndex(i)];\n if (point.skip) {\n continue;\n }\n const x = point.x;\n const y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n } else if (y > maxY) {\n maxY = y;\n }\n avgX = (countX * avgX + x) / ++countX;\n } else {\n drawX();\n ctx.lineTo(x, y);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n }\n lastY = y;\n }\n drawX();\n}\nfunction _getSegmentMethod(line) {\n const opts = line.options;\n const borderDash = opts.borderDash && opts.borderDash.length;\n const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n return useFastPath ? fastPathSegment : pathSegment;\n}\nfunction _getInterpolationMethod(options) {\n if (options.stepped) {\n return _steppedInterpolation;\n }\n if (options.tension || options.cubicInterpolationMode === 'monotone') {\n return _bezierInterpolation;\n }\n return _pointInLine;\n}\nfunction strokePathWithCache(ctx, line, start, count) {\n let path = line._path;\n if (!path) {\n path = line._path = new Path2D();\n if (line.path(path, start, count)) {\n path.closePath();\n }\n }\n setStyle(ctx, line.options);\n ctx.stroke(path);\n}\nfunction strokePathDirect(ctx, line, start, count) {\n const {segments, options} = line;\n const segmentMethod = _getSegmentMethod(line);\n for (const segment of segments) {\n setStyle(ctx, options, segment.style);\n ctx.beginPath();\n if (segmentMethod(ctx, line, segment, {start, end: start + count - 1})) {\n ctx.closePath();\n }\n ctx.stroke();\n }\n}\nconst usePath2D = typeof Path2D === 'function';\nfunction draw(ctx, line, start, count) {\n if (usePath2D && !line.options.segment) {\n strokePathWithCache(ctx, line, start, count);\n } else {\n strokePathDirect(ctx, line, start, count);\n }\n}\nclass LineElement extends Element {\n constructor(cfg) {\n super();\n this.animated = true;\n this.options = undefined;\n this._chart = undefined;\n this._loop = undefined;\n this._fullLoop = undefined;\n this._path = undefined;\n this._points = undefined;\n this._segments = undefined;\n this._decimated = false;\n this._pointsUpdated = false;\n this._datasetIndex = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n updateControlPoints(chartArea, indexAxis) {\n const options = this.options;\n if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n const loop = options.spanGaps ? this._loop : this._fullLoop;\n _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n this._pointsUpdated = true;\n }\n }\n set points(points) {\n this._points = points;\n delete this._segments;\n delete this._path;\n this._pointsUpdated = false;\n }\n get points() {\n return this._points;\n }\n get segments() {\n return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n }\n first() {\n const segments = this.segments;\n const points = this.points;\n return segments.length && points[segments[0].start];\n }\n last() {\n const segments = this.segments;\n const points = this.points;\n const count = segments.length;\n return count && points[segments[count - 1].end];\n }\n interpolate(point, property) {\n const options = this.options;\n const value = point[property];\n const points = this.points;\n const segments = _boundSegments(this, {property, start: value, end: value});\n if (!segments.length) {\n return;\n }\n const result = [];\n const _interpolate = _getInterpolationMethod(options);\n let i, ilen;\n for (i = 0, ilen = segments.length; i < ilen; ++i) {\n const {start, end} = segments[i];\n const p1 = points[start];\n const p2 = points[end];\n if (p1 === p2) {\n result.push(p1);\n continue;\n }\n const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n const interpolated = _interpolate(p1, p2, t, options.stepped);\n interpolated[property] = point[property];\n result.push(interpolated);\n }\n return result.length === 1 ? result[0] : result;\n }\n pathSegment(ctx, segment, params) {\n const segmentMethod = _getSegmentMethod(this);\n return segmentMethod(ctx, this, segment, params);\n }\n path(ctx, start, count) {\n const segments = this.segments;\n const segmentMethod = _getSegmentMethod(this);\n let loop = this._loop;\n start = start || 0;\n count = count || (this.points.length - start);\n for (const segment of segments) {\n loop &= segmentMethod(ctx, this, segment, {start, end: start + count - 1});\n }\n return !!loop;\n }\n draw(ctx, chartArea, start, count) {\n const options = this.options || {};\n const points = this.points || [];\n if (points.length && options.borderWidth) {\n ctx.save();\n draw(ctx, this, start, count);\n ctx.restore();\n }\n if (this.animated) {\n this._pointsUpdated = false;\n this._path = undefined;\n }\n }\n}\nLineElement.id = 'line';\nLineElement.defaults = {\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0,\n borderJoinStyle: 'miter',\n borderWidth: 3,\n capBezierPoints: true,\n cubicInterpolationMode: 'default',\n fill: false,\n spanGaps: false,\n stepped: false,\n tension: 0,\n};\nLineElement.defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n};\nLineElement.descriptors = {\n _scriptable: true,\n _indexable: (name) => name !== 'borderDash' && name !== 'fill',\n};\n\nfunction inRange$1(el, pos, axis, useFinalPosition) {\n const options = el.options;\n const {[axis]: value} = el.getProps([axis], useFinalPosition);\n return (Math.abs(pos - value) < options.radius + options.hitRadius);\n}\nclass PointElement extends Element {\n constructor(cfg) {\n super();\n this.options = undefined;\n this.parsed = undefined;\n this.skip = undefined;\n this.stop = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n const options = this.options;\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return ((Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2)) < Math.pow(options.hitRadius + options.radius, 2));\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange$1(this, mouseX, 'x', useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange$1(this, mouseY, 'y', useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n return {x, y};\n }\n size(options) {\n options = options || this.options || {};\n let radius = options.radius || 0;\n radius = Math.max(radius, radius && options.hoverRadius || 0);\n const borderWidth = radius && options.borderWidth || 0;\n return (radius + borderWidth) * 2;\n }\n draw(ctx, area) {\n const options = this.options;\n if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n return;\n }\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.fillStyle = options.backgroundColor;\n drawPoint(ctx, options, this.x, this.y);\n }\n getRange() {\n const options = this.options || {};\n return options.radius + options.hitRadius;\n }\n}\nPointElement.id = 'point';\nPointElement.defaults = {\n borderWidth: 1,\n hitRadius: 1,\n hoverBorderWidth: 1,\n hoverRadius: 4,\n pointStyle: 'circle',\n radius: 3,\n rotation: 0\n};\nPointElement.defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n};\n\nfunction getBarBounds(bar, useFinalPosition) {\n const {x, y, base, width, height} = bar.getProps(['x', 'y', 'base', 'width', 'height'], useFinalPosition);\n let left, right, top, bottom, half;\n if (bar.horizontal) {\n half = height / 2;\n left = Math.min(x, base);\n right = Math.max(x, base);\n top = y - half;\n bottom = y + half;\n } else {\n half = width / 2;\n left = x - half;\n right = x + half;\n top = Math.min(y, base);\n bottom = Math.max(y, base);\n }\n return {left, top, right, bottom};\n}\nfunction skipOrLimit(skip, value, min, max) {\n return skip ? 0 : _limitValue(value, min, max);\n}\nfunction parseBorderWidth(bar, maxW, maxH) {\n const value = bar.options.borderWidth;\n const skip = bar.borderSkipped;\n const o = toTRBL(value);\n return {\n t: skipOrLimit(skip.top, o.top, 0, maxH),\n r: skipOrLimit(skip.right, o.right, 0, maxW),\n b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n l: skipOrLimit(skip.left, o.left, 0, maxW)\n };\n}\nfunction parseBorderRadius(bar, maxW, maxH) {\n const {enableBorderRadius} = bar.getProps(['enableBorderRadius']);\n const value = bar.options.borderRadius;\n const o = toTRBLCorners(value);\n const maxR = Math.min(maxW, maxH);\n const skip = bar.borderSkipped;\n const enableBorder = enableBorderRadius || isObject(value);\n return {\n topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n };\n}\nfunction boundingRects(bar) {\n const bounds = getBarBounds(bar);\n const width = bounds.right - bounds.left;\n const height = bounds.bottom - bounds.top;\n const border = parseBorderWidth(bar, width / 2, height / 2);\n const radius = parseBorderRadius(bar, width / 2, height / 2);\n return {\n outer: {\n x: bounds.left,\n y: bounds.top,\n w: width,\n h: height,\n radius\n },\n inner: {\n x: bounds.left + border.l,\n y: bounds.top + border.t,\n w: width - border.l - border.r,\n h: height - border.t - border.b,\n radius: {\n topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r)),\n }\n }\n };\n}\nfunction inRange(bar, x, y, useFinalPosition) {\n const skipX = x === null;\n const skipY = y === null;\n const skipBoth = skipX && skipY;\n const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n return bounds\n\t\t&& (skipX || _isBetween(x, bounds.left, bounds.right))\n\t\t&& (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\nfunction hasRadius(radius) {\n return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\nfunction addNormalRectPath(ctx, rect) {\n ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\nfunction inflateRect(rect, amount, refRect = {}) {\n const x = rect.x !== refRect.x ? -amount : 0;\n const y = rect.y !== refRect.y ? -amount : 0;\n const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n return {\n x: rect.x + x,\n y: rect.y + y,\n w: rect.w + w,\n h: rect.h + h,\n radius: rect.radius\n };\n}\nclass BarElement extends Element {\n constructor(cfg) {\n super();\n this.options = undefined;\n this.horizontal = undefined;\n this.base = undefined;\n this.width = undefined;\n this.height = undefined;\n this.inflateAmount = undefined;\n if (cfg) {\n Object.assign(this, cfg);\n }\n }\n draw(ctx) {\n const {inflateAmount, options: {borderColor, backgroundColor}} = this;\n const {inner, outer} = boundingRects(this);\n const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n ctx.save();\n if (outer.w !== inner.w || outer.h !== inner.h) {\n ctx.beginPath();\n addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n ctx.clip();\n addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n ctx.fillStyle = borderColor;\n ctx.fill('evenodd');\n }\n ctx.beginPath();\n addRectPath(ctx, inflateRect(inner, inflateAmount));\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n inRange(mouseX, mouseY, useFinalPosition) {\n return inRange(this, mouseX, mouseY, useFinalPosition);\n }\n inXRange(mouseX, useFinalPosition) {\n return inRange(this, mouseX, null, useFinalPosition);\n }\n inYRange(mouseY, useFinalPosition) {\n return inRange(this, null, mouseY, useFinalPosition);\n }\n getCenterPoint(useFinalPosition) {\n const {x, y, base, horizontal} = this.getProps(['x', 'y', 'base', 'horizontal'], useFinalPosition);\n return {\n x: horizontal ? (x + base) / 2 : x,\n y: horizontal ? y : (y + base) / 2\n };\n }\n getRange(axis) {\n return axis === 'x' ? this.width / 2 : this.height / 2;\n }\n}\nBarElement.id = 'bar';\nBarElement.defaults = {\n borderSkipped: 'start',\n borderWidth: 0,\n borderRadius: 0,\n inflateAmount: 'auto',\n pointStyle: undefined\n};\nBarElement.defaultRoutes = {\n backgroundColor: 'backgroundColor',\n borderColor: 'borderColor'\n};\n\nvar elements = /*#__PURE__*/Object.freeze({\n__proto__: null,\nArcElement: ArcElement,\nLineElement: LineElement,\nPointElement: PointElement,\nBarElement: BarElement\n});\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n const samples = options.samples || availableWidth;\n if (samples >= count) {\n return data.slice(start, start + count);\n }\n const decimated = [];\n const bucketWidth = (count - 2) / (samples - 2);\n let sampledIndex = 0;\n const endIndex = start + count - 1;\n let a = start;\n let i, maxAreaPoint, maxArea, area, nextA;\n decimated[sampledIndex++] = data[a];\n for (i = 0; i < samples - 2; i++) {\n let avgX = 0;\n let avgY = 0;\n let j;\n const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n const avgRangeLength = avgRangeEnd - avgRangeStart;\n for (j = avgRangeStart; j < avgRangeEnd; j++) {\n avgX += data[j].x;\n avgY += data[j].y;\n }\n avgX /= avgRangeLength;\n avgY /= avgRangeLength;\n const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n const {x: pointAx, y: pointAy} = data[a];\n maxArea = area = -1;\n for (j = rangeOffs; j < rangeTo; j++) {\n area = 0.5 * Math.abs(\n (pointAx - avgX) * (data[j].y - pointAy) -\n (pointAx - data[j].x) * (avgY - pointAy)\n );\n if (area > maxArea) {\n maxArea = area;\n maxAreaPoint = data[j];\n nextA = j;\n }\n }\n decimated[sampledIndex++] = maxAreaPoint;\n a = nextA;\n }\n decimated[sampledIndex++] = data[endIndex];\n return decimated;\n}\nfunction minMaxDecimation(data, start, count, availableWidth) {\n let avgX = 0;\n let countX = 0;\n let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n const decimated = [];\n const endIndex = start + count - 1;\n const xMin = data[start].x;\n const xMax = data[endIndex].x;\n const dx = xMax - xMin;\n for (i = start; i < start + count; ++i) {\n point = data[i];\n x = (point.x - xMin) / dx * availableWidth;\n y = point.y;\n const truncX = x | 0;\n if (truncX === prevX) {\n if (y < minY) {\n minY = y;\n minIndex = i;\n } else if (y > maxY) {\n maxY = y;\n maxIndex = i;\n }\n avgX = (countX * avgX + point.x) / ++countX;\n } else {\n const lastIndex = i - 1;\n if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n const intermediateIndex1 = Math.min(minIndex, maxIndex);\n const intermediateIndex2 = Math.max(minIndex, maxIndex);\n if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex1],\n x: avgX,\n });\n }\n if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n decimated.push({\n ...data[intermediateIndex2],\n x: avgX\n });\n }\n }\n if (i > 0 && lastIndex !== startIndex) {\n decimated.push(data[lastIndex]);\n }\n decimated.push(point);\n prevX = truncX;\n countX = 0;\n minY = maxY = y;\n minIndex = maxIndex = startIndex = i;\n }\n }\n return decimated;\n}\nfunction cleanDecimatedDataset(dataset) {\n if (dataset._decimated) {\n const data = dataset._data;\n delete dataset._decimated;\n delete dataset._data;\n Object.defineProperty(dataset, 'data', {value: data});\n }\n}\nfunction cleanDecimatedData(chart) {\n chart.data.datasets.forEach((dataset) => {\n cleanDecimatedDataset(dataset);\n });\n}\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n const pointCount = points.length;\n let start = 0;\n let count;\n const {iScale} = meta;\n const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n if (minDefined) {\n start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n }\n if (maxDefined) {\n count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n } else {\n count = pointCount - start;\n }\n return {start, count};\n}\nvar plugin_decimation = {\n id: 'decimation',\n defaults: {\n algorithm: 'min-max',\n enabled: false,\n },\n beforeElementsUpdate: (chart, args, options) => {\n if (!options.enabled) {\n cleanDecimatedData(chart);\n return;\n }\n const availableWidth = chart.width;\n chart.data.datasets.forEach((dataset, datasetIndex) => {\n const {_data, indexAxis} = dataset;\n const meta = chart.getDatasetMeta(datasetIndex);\n const data = _data || dataset.data;\n if (resolve([indexAxis, chart.options.indexAxis]) === 'y') {\n return;\n }\n if (meta.type !== 'line') {\n return;\n }\n const xAxis = chart.scales[meta.xAxisID];\n if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n return;\n }\n if (chart.options.parsing) {\n return;\n }\n let {start, count} = getStartAndCountOfVisiblePointsSimplified(meta, data);\n const threshold = options.threshold || 4 * availableWidth;\n if (count <= threshold) {\n cleanDecimatedDataset(dataset);\n return;\n }\n if (isNullOrUndef(_data)) {\n dataset._data = data;\n delete dataset.data;\n Object.defineProperty(dataset, 'data', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this._decimated;\n },\n set: function(d) {\n this._data = d;\n }\n });\n }\n let decimated;\n switch (options.algorithm) {\n case 'lttb':\n decimated = lttbDecimation(data, start, count, availableWidth, options);\n break;\n case 'min-max':\n decimated = minMaxDecimation(data, start, count, availableWidth);\n break;\n default:\n throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n }\n dataset._decimated = decimated;\n });\n },\n destroy(chart) {\n cleanDecimatedData(chart);\n }\n};\n\nfunction getLineByIndex(chart, index) {\n const meta = chart.getDatasetMeta(index);\n const visible = meta && chart.isDatasetVisible(index);\n return visible ? meta.dataset : null;\n}\nfunction parseFillOption(line) {\n const options = line.options;\n const fillOption = options.fill;\n let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n if (fill === undefined) {\n fill = !!options.backgroundColor;\n }\n if (fill === false || fill === null) {\n return false;\n }\n if (fill === true) {\n return 'origin';\n }\n return fill;\n}\nfunction decodeFill(line, index, count) {\n const fill = parseFillOption(line);\n if (isObject(fill)) {\n return isNaN(fill.value) ? false : fill;\n }\n let target = parseFloat(fill);\n if (isNumberFinite(target) && Math.floor(target) === target) {\n if (fill[0] === '-' || fill[0] === '+') {\n target = index + target;\n }\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n return target;\n }\n return ['origin', 'start', 'end', 'stack', 'shape'].indexOf(fill) >= 0 && fill;\n}\nfunction computeLinearBoundary(source) {\n const {scale = {}, fill} = source;\n let target = null;\n let horizontal;\n if (fill === 'start') {\n target = scale.bottom;\n } else if (fill === 'end') {\n target = scale.top;\n } else if (isObject(fill)) {\n target = scale.getPixelForValue(fill.value);\n } else if (scale.getBasePixel) {\n target = scale.getBasePixel();\n }\n if (isNumberFinite(target)) {\n horizontal = scale.isHorizontal();\n return {\n x: horizontal ? target : null,\n y: horizontal ? null : target\n };\n }\n return null;\n}\nclass simpleArc {\n constructor(opts) {\n this.x = opts.x;\n this.y = opts.y;\n this.radius = opts.radius;\n }\n pathSegment(ctx, bounds, opts) {\n const {x, y, radius} = this;\n bounds = bounds || {start: 0, end: TAU};\n ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n return !opts.bounds;\n }\n interpolate(point) {\n const {x, y, radius} = this;\n const angle = point.angle;\n return {\n x: x + Math.cos(angle) * radius,\n y: y + Math.sin(angle) * radius,\n angle\n };\n }\n}\nfunction computeCircularBoundary(source) {\n const {scale, fill} = source;\n const options = scale.options;\n const length = scale.getLabels().length;\n const target = [];\n const start = options.reverse ? scale.max : scale.min;\n const end = options.reverse ? scale.min : scale.max;\n let i, center, value;\n if (fill === 'start') {\n value = start;\n } else if (fill === 'end') {\n value = end;\n } else if (isObject(fill)) {\n value = fill.value;\n } else {\n value = scale.getBaseValue();\n }\n if (options.grid.circular) {\n center = scale.getPointPositionForValue(0, start);\n return new simpleArc({\n x: center.x,\n y: center.y,\n radius: scale.getDistanceFromCenterForValue(value)\n });\n }\n for (i = 0; i < length; ++i) {\n target.push(scale.getPointPositionForValue(i, value));\n }\n return target;\n}\nfunction computeBoundary(source) {\n const scale = source.scale || {};\n if (scale.getPointPositionForValue) {\n return computeCircularBoundary(source);\n }\n return computeLinearBoundary(source);\n}\nfunction findSegmentEnd(start, end, points) {\n for (;end > start; end--) {\n const point = points[end];\n if (!isNaN(point.x) && !isNaN(point.y)) {\n break;\n }\n }\n return end;\n}\nfunction pointsFromSegments(boundary, line) {\n const {x = null, y = null} = boundary || {};\n const linePoints = line.points;\n const points = [];\n line.segments.forEach(({start, end}) => {\n end = findSegmentEnd(start, end, linePoints);\n const first = linePoints[start];\n const last = linePoints[end];\n if (y !== null) {\n points.push({x: first.x, y});\n points.push({x: last.x, y});\n } else if (x !== null) {\n points.push({x, y: first.y});\n points.push({x, y: last.y});\n }\n });\n return points;\n}\nfunction buildStackLine(source) {\n const {scale, index, line} = source;\n const points = [];\n const segments = line.segments;\n const sourcePoints = line.points;\n const linesBelow = getLinesBelow(scale, index);\n linesBelow.push(createBoundaryLine({x: null, y: scale.bottom}, line));\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n for (let j = segment.start; j <= segment.end; j++) {\n addPointsBelow(points, sourcePoints[j], linesBelow);\n }\n }\n return new LineElement({points, options: {}});\n}\nfunction getLinesBelow(scale, index) {\n const below = [];\n const metas = scale.getMatchingVisibleMetas('line');\n for (let i = 0; i < metas.length; i++) {\n const meta = metas[i];\n if (meta.index === index) {\n break;\n }\n if (!meta.hidden) {\n below.unshift(meta.dataset);\n }\n }\n return below;\n}\nfunction addPointsBelow(points, sourcePoint, linesBelow) {\n const postponed = [];\n for (let j = 0; j < linesBelow.length; j++) {\n const line = linesBelow[j];\n const {first, last, point} = findPoint(line, sourcePoint, 'x');\n if (!point || (first && last)) {\n continue;\n }\n if (first) {\n postponed.unshift(point);\n } else {\n points.push(point);\n if (!last) {\n break;\n }\n }\n }\n points.push(...postponed);\n}\nfunction findPoint(line, sourcePoint, property) {\n const point = line.interpolate(sourcePoint, property);\n if (!point) {\n return {};\n }\n const pointValue = point[property];\n const segments = line.segments;\n const linePoints = line.points;\n let first = false;\n let last = false;\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n const firstValue = linePoints[segment.start][property];\n const lastValue = linePoints[segment.end][property];\n if (_isBetween(pointValue, firstValue, lastValue)) {\n first = pointValue === firstValue;\n last = pointValue === lastValue;\n break;\n }\n }\n return {first, last, point};\n}\nfunction getTarget(source) {\n const {chart, fill, line} = source;\n if (isNumberFinite(fill)) {\n return getLineByIndex(chart, fill);\n }\n if (fill === 'stack') {\n return buildStackLine(source);\n }\n if (fill === 'shape') {\n return true;\n }\n const boundary = computeBoundary(source);\n if (boundary instanceof simpleArc) {\n return boundary;\n }\n return createBoundaryLine(boundary, line);\n}\nfunction createBoundaryLine(boundary, line) {\n let points = [];\n let _loop = false;\n if (isArray(boundary)) {\n _loop = true;\n points = boundary;\n } else {\n points = pointsFromSegments(boundary, line);\n }\n return points.length ? new LineElement({\n points,\n options: {tension: 0},\n _loop,\n _fullLoop: _loop\n }) : null;\n}\nfunction resolveTarget(sources, index, propagate) {\n const source = sources[index];\n let fill = source.fill;\n const visited = [index];\n let target;\n if (!propagate) {\n return fill;\n }\n while (fill !== false && visited.indexOf(fill) === -1) {\n if (!isNumberFinite(fill)) {\n return fill;\n }\n target = sources[fill];\n if (!target) {\n return false;\n }\n if (target.visible) {\n return fill;\n }\n visited.push(fill);\n fill = target.fill;\n }\n return false;\n}\nfunction _clip(ctx, target, clipY) {\n const {segments, points} = target;\n let first = true;\n let lineLoop = false;\n ctx.beginPath();\n for (const segment of segments) {\n const {start, end} = segment;\n const firstPoint = points[start];\n const lastPoint = points[findSegmentEnd(start, end, points)];\n if (first) {\n ctx.moveTo(firstPoint.x, firstPoint.y);\n first = false;\n } else {\n ctx.lineTo(firstPoint.x, clipY);\n ctx.lineTo(firstPoint.x, firstPoint.y);\n }\n lineLoop = !!target.pathSegment(ctx, segment, {move: lineLoop});\n if (lineLoop) {\n ctx.closePath();\n } else {\n ctx.lineTo(lastPoint.x, clipY);\n }\n }\n ctx.lineTo(target.first().x, clipY);\n ctx.closePath();\n ctx.clip();\n}\nfunction getBounds(property, first, last, loop) {\n if (loop) {\n return;\n }\n let start = first[property];\n let end = last[property];\n if (property === 'angle') {\n start = _normalizeAngle(start);\n end = _normalizeAngle(end);\n }\n return {property, start, end};\n}\nfunction _getEdge(a, b, prop, fn) {\n if (a && b) {\n return fn(a[prop], b[prop]);\n }\n return a ? a[prop] : b ? b[prop] : 0;\n}\nfunction _segments(line, target, property) {\n const segments = line.segments;\n const points = line.points;\n const tpoints = target.points;\n const parts = [];\n for (const segment of segments) {\n let {start, end} = segment;\n end = findSegmentEnd(start, end, points);\n const bounds = getBounds(property, points[start], points[end], segment.loop);\n if (!target.segments) {\n parts.push({\n source: segment,\n target: bounds,\n start: points[start],\n end: points[end]\n });\n continue;\n }\n const targetSegments = _boundSegments(target, bounds);\n for (const tgt of targetSegments) {\n const subBounds = getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n const fillSources = _boundSegment(segment, points, subBounds);\n for (const fillSource of fillSources) {\n parts.push({\n source: fillSource,\n target: tgt,\n start: {\n [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n },\n end: {\n [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n }\n });\n }\n }\n }\n return parts;\n}\nfunction clipBounds(ctx, scale, bounds) {\n const {top, bottom} = scale.chart.chartArea;\n const {property, start, end} = bounds || {};\n if (property === 'x') {\n ctx.beginPath();\n ctx.rect(start, top, end - start, bottom - top);\n ctx.clip();\n }\n}\nfunction interpolatedLineTo(ctx, target, point, property) {\n const interpolatedPoint = target.interpolate(point, property);\n if (interpolatedPoint) {\n ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n }\n}\nfunction _fill(ctx, cfg) {\n const {line, target, property, color, scale} = cfg;\n const segments = _segments(line, target, property);\n for (const {source: src, target: tgt, start, end} of segments) {\n const {style: {backgroundColor = color} = {}} = src;\n const notShape = target !== true;\n ctx.save();\n ctx.fillStyle = backgroundColor;\n clipBounds(ctx, scale, notShape && getBounds(property, start, end));\n ctx.beginPath();\n const lineLoop = !!line.pathSegment(ctx, src);\n let loop;\n if (notShape) {\n if (lineLoop) {\n ctx.closePath();\n } else {\n interpolatedLineTo(ctx, target, end, property);\n }\n const targetLoop = !!target.pathSegment(ctx, tgt, {move: lineLoop, reverse: true});\n loop = lineLoop && targetLoop;\n if (!loop) {\n interpolatedLineTo(ctx, target, start, property);\n }\n }\n ctx.closePath();\n ctx.fill(loop ? 'evenodd' : 'nonzero');\n ctx.restore();\n }\n}\nfunction doFill(ctx, cfg) {\n const {line, target, above, below, area, scale} = cfg;\n const property = line._loop ? 'angle' : cfg.axis;\n ctx.save();\n if (property === 'x' && below !== above) {\n _clip(ctx, target, area.top);\n _fill(ctx, {line, target, color: above, scale, property});\n ctx.restore();\n ctx.save();\n _clip(ctx, target, area.bottom);\n }\n _fill(ctx, {line, target, color: below, scale, property});\n ctx.restore();\n}\nfunction drawfill(ctx, source, area) {\n const target = getTarget(source);\n const {line, scale, axis} = source;\n const lineOpts = line.options;\n const fillOption = lineOpts.fill;\n const color = lineOpts.backgroundColor;\n const {above = color, below = color} = fillOption || {};\n if (target && line.points.length) {\n clipArea(ctx, area);\n doFill(ctx, {line, target, above, below, area, scale, axis});\n unclipArea(ctx);\n }\n}\nvar plugin_filler = {\n id: 'filler',\n afterDatasetsUpdate(chart, _args, options) {\n const count = (chart.data.datasets || []).length;\n const sources = [];\n let meta, i, line, source;\n for (i = 0; i < count; ++i) {\n meta = chart.getDatasetMeta(i);\n line = meta.dataset;\n source = null;\n if (line && line.options && line instanceof LineElement) {\n source = {\n visible: chart.isDatasetVisible(i),\n index: i,\n fill: decodeFill(line, i, count),\n chart,\n axis: meta.controller.options.indexAxis,\n scale: meta.vScale,\n line,\n };\n }\n meta.$filler = source;\n sources.push(source);\n }\n for (i = 0; i < count; ++i) {\n source = sources[i];\n if (!source || source.fill === false) {\n continue;\n }\n source.fill = resolveTarget(sources, i, options.propagate);\n }\n },\n beforeDraw(chart, _args, options) {\n const draw = options.drawTime === 'beforeDraw';\n const metasets = chart.getSortedVisibleDatasetMetas();\n const area = chart.chartArea;\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n if (!source) {\n continue;\n }\n source.line.updateControlPoints(area, source.axis);\n if (draw) {\n drawfill(chart.ctx, source, area);\n }\n }\n },\n beforeDatasetsDraw(chart, _args, options) {\n if (options.drawTime !== 'beforeDatasetsDraw') {\n return;\n }\n const metasets = chart.getSortedVisibleDatasetMetas();\n for (let i = metasets.length - 1; i >= 0; --i) {\n const source = metasets[i].$filler;\n if (source) {\n drawfill(chart.ctx, source, chart.chartArea);\n }\n }\n },\n beforeDatasetDraw(chart, args, options) {\n const source = args.meta.$filler;\n if (!source || source.fill === false || options.drawTime !== 'beforeDatasetDraw') {\n return;\n }\n drawfill(chart.ctx, source, chart.chartArea);\n },\n defaults: {\n propagate: true,\n drawTime: 'beforeDatasetDraw'\n }\n};\n\nconst getBoxSize = (labelOpts, fontSize) => {\n let {boxHeight = fontSize, boxWidth = fontSize} = labelOpts;\n if (labelOpts.usePointStyle) {\n boxHeight = Math.min(boxHeight, fontSize);\n boxWidth = Math.min(boxWidth, fontSize);\n }\n return {\n boxWidth,\n boxHeight,\n itemHeight: Math.max(fontSize, boxHeight)\n };\n};\nconst itemsEqual = (a, b) => a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\nclass Legend extends Element {\n constructor(config) {\n super();\n this._added = false;\n this.legendHitBoxes = [];\n this._hoveredItem = null;\n this.doughnutMode = false;\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this.legendItems = undefined;\n this.columnSizes = undefined;\n this.lineWidths = undefined;\n this.maxHeight = undefined;\n this.maxWidth = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.height = undefined;\n this.width = undefined;\n this._margins = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight, margins) {\n this.maxWidth = maxWidth;\n this.maxHeight = maxHeight;\n this._margins = margins;\n this.setDimensions();\n this.buildLabels();\n this.fit();\n }\n setDimensions() {\n if (this.isHorizontal()) {\n this.width = this.maxWidth;\n this.left = this._margins.left;\n this.right = this.width;\n } else {\n this.height = this.maxHeight;\n this.top = this._margins.top;\n this.bottom = this.height;\n }\n }\n buildLabels() {\n const labelOpts = this.options.labels || {};\n let legendItems = callback(labelOpts.generateLabels, [this.chart], this) || [];\n if (labelOpts.filter) {\n legendItems = legendItems.filter((item) => labelOpts.filter(item, this.chart.data));\n }\n if (labelOpts.sort) {\n legendItems = legendItems.sort((a, b) => labelOpts.sort(a, b, this.chart.data));\n }\n if (this.options.reverse) {\n legendItems.reverse();\n }\n this.legendItems = legendItems;\n }\n fit() {\n const {options, ctx} = this;\n if (!options.display) {\n this.width = this.height = 0;\n return;\n }\n const labelOpts = options.labels;\n const labelFont = toFont(labelOpts.font);\n const fontSize = labelFont.size;\n const titleHeight = this._computeTitleHeight();\n const {boxWidth, itemHeight} = getBoxSize(labelOpts, fontSize);\n let width, height;\n ctx.font = labelFont.string;\n if (this.isHorizontal()) {\n width = this.maxWidth;\n height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n } else {\n height = this.maxHeight;\n width = this._fitCols(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n }\n this.width = Math.min(width, options.maxWidth || this.maxWidth);\n this.height = Math.min(height, options.maxHeight || this.maxHeight);\n }\n _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n const {ctx, maxWidth, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n const lineWidths = this.lineWidths = [0];\n const lineHeight = itemHeight + padding;\n let totalHeight = titleHeight;\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n let row = -1;\n let top = -lineHeight;\n this.legendItems.forEach((legendItem, i) => {\n const itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n totalHeight += lineHeight;\n lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n top += lineHeight;\n row++;\n }\n hitboxes[i] = {left: 0, top, row, width: itemWidth, height: itemHeight};\n lineWidths[lineWidths.length - 1] += itemWidth + padding;\n });\n return totalHeight;\n }\n _fitCols(titleHeight, fontSize, boxWidth, itemHeight) {\n const {ctx, maxHeight, options: {labels: {padding}}} = this;\n const hitboxes = this.legendHitBoxes = [];\n const columnSizes = this.columnSizes = [];\n const heightLimit = maxHeight - titleHeight;\n let totalWidth = padding;\n let currentColWidth = 0;\n let currentColHeight = 0;\n let left = 0;\n let col = 0;\n this.legendItems.forEach((legendItem, i) => {\n const itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n totalWidth += currentColWidth + padding;\n columnSizes.push({width: currentColWidth, height: currentColHeight});\n left += currentColWidth + padding;\n col++;\n currentColWidth = currentColHeight = 0;\n }\n hitboxes[i] = {left, top: currentColHeight, col, width: itemWidth, height: itemHeight};\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight + padding;\n });\n totalWidth += currentColWidth;\n columnSizes.push({width: currentColWidth, height: currentColHeight});\n return totalWidth;\n }\n adjustHitBoxes() {\n if (!this.options.display) {\n return;\n }\n const titleHeight = this._computeTitleHeight();\n const {legendHitBoxes: hitboxes, options: {align, labels: {padding}, rtl}} = this;\n const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n if (this.isHorizontal()) {\n let row = 0;\n let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n for (const hitbox of hitboxes) {\n if (row !== hitbox.row) {\n row = hitbox.row;\n left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n }\n hitbox.top += this.top + titleHeight + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n left += hitbox.width + padding;\n }\n } else {\n let col = 0;\n let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n for (const hitbox of hitboxes) {\n if (hitbox.col !== col) {\n col = hitbox.col;\n top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n }\n hitbox.top = top;\n hitbox.left += this.left + padding;\n hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n top += hitbox.height + padding;\n }\n }\n }\n isHorizontal() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n }\n draw() {\n if (this.options.display) {\n const ctx = this.ctx;\n clipArea(ctx, this);\n this._draw();\n unclipArea(ctx);\n }\n }\n _draw() {\n const {options: opts, columnSizes, lineWidths, ctx} = this;\n const {align, labels: labelOpts} = opts;\n const defaultColor = defaults.color;\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const labelFont = toFont(labelOpts.font);\n const {color: fontColor, padding} = labelOpts;\n const fontSize = labelFont.size;\n const halfFontSize = fontSize / 2;\n let cursor;\n this.drawTitle();\n ctx.textAlign = rtlHelper.textAlign('left');\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.font = labelFont.string;\n const {boxWidth, boxHeight, itemHeight} = getBoxSize(labelOpts, fontSize);\n const drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n return;\n }\n ctx.save();\n const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n if (labelOpts.usePointStyle) {\n const drawOptions = {\n radius: boxWidth * Math.SQRT2 / 2,\n pointStyle: legendItem.pointStyle,\n rotation: legendItem.rotation,\n borderWidth: lineWidth\n };\n const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n const centerY = y + halfFontSize;\n drawPoint(ctx, drawOptions, centerX, centerY);\n } else {\n const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n const borderRadius = toTRBLCorners(legendItem.borderRadius);\n ctx.beginPath();\n if (Object.values(borderRadius).some(v => v !== 0)) {\n addRoundedRectPath(ctx, {\n x: xBoxLeft,\n y: yBoxTop,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n } else {\n ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n }\n ctx.fill();\n if (lineWidth !== 0) {\n ctx.stroke();\n }\n }\n ctx.restore();\n };\n const fillText = function(x, y, legendItem) {\n renderText(ctx, legendItem.text, x, y + (itemHeight / 2), labelFont, {\n strikethrough: legendItem.hidden,\n textAlign: rtlHelper.textAlign(legendItem.textAlign)\n });\n };\n const isHorizontal = this.isHorizontal();\n const titleHeight = this._computeTitleHeight();\n if (isHorizontal) {\n cursor = {\n x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n y: this.top + padding + titleHeight,\n line: 0\n };\n } else {\n cursor = {\n x: this.left + padding,\n y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n line: 0\n };\n }\n overrideTextDirection(this.ctx, opts.textDirection);\n const lineHeight = itemHeight + padding;\n this.legendItems.forEach((legendItem, i) => {\n ctx.strokeStyle = legendItem.fontColor || fontColor;\n ctx.fillStyle = legendItem.fontColor || fontColor;\n const textWidth = ctx.measureText(legendItem.text).width;\n const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n const width = boxWidth + halfFontSize + textWidth;\n let x = cursor.x;\n let y = cursor.y;\n rtlHelper.setWidth(this.width);\n if (isHorizontal) {\n if (i > 0 && x + width + padding > this.right) {\n y = cursor.y += lineHeight;\n cursor.line++;\n x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n }\n } else if (i > 0 && y + lineHeight > this.bottom) {\n x = cursor.x = x + columnSizes[cursor.line].width + padding;\n cursor.line++;\n y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n }\n const realX = rtlHelper.x(x);\n drawLegendBox(realX, y, legendItem);\n x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n fillText(rtlHelper.x(x), y, legendItem);\n if (isHorizontal) {\n cursor.x += width + padding;\n } else {\n cursor.y += lineHeight;\n }\n });\n restoreTextDirection(this.ctx, opts.textDirection);\n }\n drawTitle() {\n const opts = this.options;\n const titleOpts = opts.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n if (!titleOpts.display) {\n return;\n }\n const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n const ctx = this.ctx;\n const position = titleOpts.position;\n const halfFontSize = titleFont.size / 2;\n const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n let y;\n let left = this.left;\n let maxWidth = this.width;\n if (this.isHorizontal()) {\n maxWidth = Math.max(...this.lineWidths);\n y = this.top + topPaddingPlusHalfFontSize;\n left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n } else {\n const maxHeight = this.columnSizes.reduce((acc, size) => Math.max(acc, size.height), 0);\n y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n }\n const x = _alignStartEnd(position, left, left + maxWidth);\n ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n ctx.textBaseline = 'middle';\n ctx.strokeStyle = titleOpts.color;\n ctx.fillStyle = titleOpts.color;\n ctx.font = titleFont.string;\n renderText(ctx, titleOpts.text, x, y, titleFont);\n }\n _computeTitleHeight() {\n const titleOpts = this.options.title;\n const titleFont = toFont(titleOpts.font);\n const titlePadding = toPadding(titleOpts.padding);\n return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n }\n _getLegendItemAt(x, y) {\n let i, hitBox, lh;\n if (_isBetween(x, this.left, this.right)\n && _isBetween(y, this.top, this.bottom)) {\n lh = this.legendHitBoxes;\n for (i = 0; i < lh.length; ++i) {\n hitBox = lh[i];\n if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width)\n && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n return this.legendItems[i];\n }\n }\n }\n return null;\n }\n handleEvent(e) {\n const opts = this.options;\n if (!isListened(e.type, opts)) {\n return;\n }\n const hoveredItem = this._getLegendItemAt(e.x, e.y);\n if (e.type === 'mousemove') {\n const previous = this._hoveredItem;\n const sameItem = itemsEqual(previous, hoveredItem);\n if (previous && !sameItem) {\n callback(opts.onLeave, [e, previous, this], this);\n }\n this._hoveredItem = hoveredItem;\n if (hoveredItem && !sameItem) {\n callback(opts.onHover, [e, hoveredItem, this], this);\n }\n } else if (hoveredItem) {\n callback(opts.onClick, [e, hoveredItem, this], this);\n }\n }\n}\nfunction isListened(type, opts) {\n if (type === 'mousemove' && (opts.onHover || opts.onLeave)) {\n return true;\n }\n if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n return true;\n }\n return false;\n}\nvar plugin_legend = {\n id: 'legend',\n _element: Legend,\n start(chart, _args, options) {\n const legend = chart.legend = new Legend({ctx: chart.ctx, options, chart});\n layouts.configure(chart, legend, options);\n layouts.addBox(chart, legend);\n },\n stop(chart) {\n layouts.removeBox(chart, chart.legend);\n delete chart.legend;\n },\n beforeUpdate(chart, _args, options) {\n const legend = chart.legend;\n layouts.configure(chart, legend, options);\n legend.options = options;\n },\n afterUpdate(chart) {\n const legend = chart.legend;\n legend.buildLabels();\n legend.adjustHitBoxes();\n },\n afterEvent(chart, args) {\n if (!args.replay) {\n chart.legend.handleEvent(args.event);\n }\n },\n defaults: {\n display: true,\n position: 'top',\n align: 'center',\n fullSize: true,\n reverse: false,\n weight: 1000,\n onClick(e, legendItem, legend) {\n const index = legendItem.datasetIndex;\n const ci = legend.chart;\n if (ci.isDatasetVisible(index)) {\n ci.hide(index);\n legendItem.hidden = true;\n } else {\n ci.show(index);\n legendItem.hidden = false;\n }\n },\n onHover: null,\n onLeave: null,\n labels: {\n color: (ctx) => ctx.chart.options.color,\n boxWidth: 40,\n padding: 10,\n generateLabels(chart) {\n const datasets = chart.data.datasets;\n const {labels: {usePointStyle, pointStyle, textAlign, color}} = chart.legend.options;\n return chart._getSortedDatasetMetas().map((meta) => {\n const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n const borderWidth = toPadding(style.borderWidth);\n return {\n text: datasets[meta.index].label,\n fillStyle: style.backgroundColor,\n fontColor: color,\n hidden: !meta.visible,\n lineCap: style.borderCapStyle,\n lineDash: style.borderDash,\n lineDashOffset: style.borderDashOffset,\n lineJoin: style.borderJoinStyle,\n lineWidth: (borderWidth.width + borderWidth.height) / 4,\n strokeStyle: style.borderColor,\n pointStyle: pointStyle || style.pointStyle,\n rotation: style.rotation,\n textAlign: textAlign || style.textAlign,\n borderRadius: 0,\n datasetIndex: meta.index\n };\n }, this);\n }\n },\n title: {\n color: (ctx) => ctx.chart.options.color,\n display: false,\n position: 'center',\n text: '',\n }\n },\n descriptors: {\n _scriptable: (name) => !name.startsWith('on'),\n labels: {\n _scriptable: (name) => !['generateLabels', 'filter', 'sort'].includes(name),\n }\n },\n};\n\nclass Title extends Element {\n constructor(config) {\n super();\n this.chart = config.chart;\n this.options = config.options;\n this.ctx = config.ctx;\n this._padding = undefined;\n this.top = undefined;\n this.bottom = undefined;\n this.left = undefined;\n this.right = undefined;\n this.width = undefined;\n this.height = undefined;\n this.position = undefined;\n this.weight = undefined;\n this.fullSize = undefined;\n }\n update(maxWidth, maxHeight) {\n const opts = this.options;\n this.left = 0;\n this.top = 0;\n if (!opts.display) {\n this.width = this.height = this.right = this.bottom = 0;\n return;\n }\n this.width = this.right = maxWidth;\n this.height = this.bottom = maxHeight;\n const lineCount = isArray(opts.text) ? opts.text.length : 1;\n this._padding = toPadding(opts.padding);\n const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n if (this.isHorizontal()) {\n this.height = textSize;\n } else {\n this.width = textSize;\n }\n }\n isHorizontal() {\n const pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n }\n _drawArgs(offset) {\n const {top, left, bottom, right, options} = this;\n const align = options.align;\n let rotation = 0;\n let maxWidth, titleX, titleY;\n if (this.isHorizontal()) {\n titleX = _alignStartEnd(align, left, right);\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n if (options.position === 'left') {\n titleX = left + offset;\n titleY = _alignStartEnd(align, bottom, top);\n rotation = PI * -0.5;\n } else {\n titleX = right - offset;\n titleY = _alignStartEnd(align, top, bottom);\n rotation = PI * 0.5;\n }\n maxWidth = bottom - top;\n }\n return {titleX, titleY, maxWidth, rotation};\n }\n draw() {\n const ctx = this.ctx;\n const opts = this.options;\n if (!opts.display) {\n return;\n }\n const fontOpts = toFont(opts.font);\n const lineHeight = fontOpts.lineHeight;\n const offset = lineHeight / 2 + this._padding.top;\n const {titleX, titleY, maxWidth, rotation} = this._drawArgs(offset);\n renderText(ctx, opts.text, 0, 0, fontOpts, {\n color: opts.color,\n maxWidth,\n rotation,\n textAlign: _toLeftRightCenter(opts.align),\n textBaseline: 'middle',\n translation: [titleX, titleY],\n });\n }\n}\nfunction createTitle(chart, titleOpts) {\n const title = new Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart\n });\n layouts.configure(chart, title, titleOpts);\n layouts.addBox(chart, title);\n chart.titleBlock = title;\n}\nvar plugin_title = {\n id: 'title',\n _element: Title,\n start(chart, _args, options) {\n createTitle(chart, options);\n },\n stop(chart) {\n const titleBlock = chart.titleBlock;\n layouts.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n },\n beforeUpdate(chart, _args, options) {\n const title = chart.titleBlock;\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'bold',\n },\n fullSize: true,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n\nconst map = new WeakMap();\nvar plugin_subtitle = {\n id: 'subtitle',\n start(chart, _args, options) {\n const title = new Title({\n ctx: chart.ctx,\n options,\n chart\n });\n layouts.configure(chart, title, options);\n layouts.addBox(chart, title);\n map.set(chart, title);\n },\n stop(chart) {\n layouts.removeBox(chart, map.get(chart));\n map.delete(chart);\n },\n beforeUpdate(chart, _args, options) {\n const title = map.get(chart);\n layouts.configure(chart, title, options);\n title.options = options;\n },\n defaults: {\n align: 'center',\n display: false,\n font: {\n weight: 'normal',\n },\n fullSize: true,\n padding: 0,\n position: 'top',\n text: '',\n weight: 1500\n },\n defaultRoutes: {\n color: 'color'\n },\n descriptors: {\n _scriptable: true,\n _indexable: false,\n },\n};\n\nconst positioners = {\n average(items) {\n if (!items.length) {\n return false;\n }\n let i, len;\n let x = 0;\n let y = 0;\n let count = 0;\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n return {\n x: x / count,\n y: y / count\n };\n },\n nearest(items, eventPosition) {\n if (!items.length) {\n return false;\n }\n let x = eventPosition.x;\n let y = eventPosition.y;\n let minDistance = Number.POSITIVE_INFINITY;\n let i, len, nearestElement;\n for (i = 0, len = items.length; i < len; ++i) {\n const el = items[i].element;\n if (el && el.hasValue()) {\n const center = el.getCenterPoint();\n const d = distanceBetweenPoints(eventPosition, center);\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n if (nearestElement) {\n const tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n return {\n x,\n y\n };\n }\n};\nfunction pushOrConcat(base, toPush) {\n if (toPush) {\n if (isArray(toPush)) {\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n return base;\n}\nfunction splitNewlines(str) {\n if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n return str.split('\\n');\n }\n return str;\n}\nfunction createTooltipItem(chart, item) {\n const {element, datasetIndex, index} = item;\n const controller = chart.getDatasetMeta(datasetIndex).controller;\n const {label, value} = controller.getLabelAndValue(index);\n return {\n chart,\n label,\n parsed: controller.getParsed(index),\n raw: chart.data.datasets[datasetIndex].data[index],\n formattedValue: value,\n dataset: controller.getDataset(),\n dataIndex: index,\n datasetIndex,\n element\n };\n}\nfunction getTooltipSize(tooltip, options) {\n const ctx = tooltip.chart.ctx;\n const {body, footer, title} = tooltip;\n const {boxWidth, boxHeight} = options;\n const bodyFont = toFont(options.bodyFont);\n const titleFont = toFont(options.titleFont);\n const footerFont = toFont(options.footerFont);\n const titleLineCount = title.length;\n const footerLineCount = footer.length;\n const bodyLineItemCount = body.length;\n const padding = toPadding(options.padding);\n let height = padding.height;\n let width = 0;\n let combinedBodyLength = body.reduce((count, bodyItem) => count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n if (titleLineCount) {\n height += titleLineCount * titleFont.lineHeight\n\t\t\t+ (titleLineCount - 1) * options.titleSpacing\n\t\t\t+ options.titleMarginBottom;\n }\n if (combinedBodyLength) {\n const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n height += bodyLineItemCount * bodyLineHeight\n\t\t\t+ (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight\n\t\t\t+ (combinedBodyLength - 1) * options.bodySpacing;\n }\n if (footerLineCount) {\n height += options.footerMarginTop\n\t\t\t+ footerLineCount * footerFont.lineHeight\n\t\t\t+ (footerLineCount - 1) * options.footerSpacing;\n }\n let widthPadding = 0;\n const maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n ctx.save();\n ctx.font = titleFont.string;\n each(tooltip.title, maxLineWidth);\n ctx.font = bodyFont.string;\n each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n widthPadding = options.displayColors ? (boxWidth + 2 + options.boxPadding) : 0;\n each(body, (bodyItem) => {\n each(bodyItem.before, maxLineWidth);\n each(bodyItem.lines, maxLineWidth);\n each(bodyItem.after, maxLineWidth);\n });\n widthPadding = 0;\n ctx.font = footerFont.string;\n each(tooltip.footer, maxLineWidth);\n ctx.restore();\n width += padding.width;\n return {width, height};\n}\nfunction determineYAlign(chart, size) {\n const {y, height} = size;\n if (y < height / 2) {\n return 'top';\n } else if (y > (chart.height - height / 2)) {\n return 'bottom';\n }\n return 'center';\n}\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n const {x, width} = size;\n const caret = options.caretSize + options.caretPadding;\n if (xAlign === 'left' && x + width + caret > chart.width) {\n return true;\n }\n if (xAlign === 'right' && x - width - caret < 0) {\n return true;\n }\n}\nfunction determineXAlign(chart, options, size, yAlign) {\n const {x, width} = size;\n const {width: chartWidth, chartArea: {left, right}} = chart;\n let xAlign = 'center';\n if (yAlign === 'center') {\n xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n } else if (x <= width / 2) {\n xAlign = 'left';\n } else if (x >= chartWidth - width / 2) {\n xAlign = 'right';\n }\n if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n xAlign = 'center';\n }\n return xAlign;\n}\nfunction determineAlignment(chart, options, size) {\n const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n return {\n xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n yAlign\n };\n}\nfunction alignX(size, xAlign) {\n let {x, width} = size;\n if (xAlign === 'right') {\n x -= width;\n } else if (xAlign === 'center') {\n x -= (width / 2);\n }\n return x;\n}\nfunction alignY(size, yAlign, paddingAndSize) {\n let {y, height} = size;\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= height + paddingAndSize;\n } else {\n y -= (height / 2);\n }\n return y;\n}\nfunction getBackgroundPoint(options, size, alignment, chart) {\n const {caretSize, caretPadding, cornerRadius} = options;\n const {xAlign, yAlign} = alignment;\n const paddingAndSize = caretSize + caretPadding;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n let x = alignX(size, xAlign);\n const y = alignY(size, yAlign, paddingAndSize);\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= Math.max(topLeft, bottomLeft) + caretSize;\n } else if (xAlign === 'right') {\n x += Math.max(topRight, bottomRight) + caretSize;\n }\n return {\n x: _limitValue(x, 0, chart.width - size.width),\n y: _limitValue(y, 0, chart.height - size.height)\n };\n}\nfunction getAlignedX(tooltip, align, options) {\n const padding = toPadding(options.padding);\n return align === 'center'\n ? tooltip.x + tooltip.width / 2\n : align === 'right'\n ? tooltip.x + tooltip.width - padding.right\n : tooltip.x + padding.left;\n}\nfunction getBeforeAfterBodyLines(callback) {\n return pushOrConcat([], splitNewlines(callback));\n}\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n return createContext(parent, {\n tooltip,\n tooltipItems,\n type: 'tooltip'\n });\n}\nfunction overrideCallbacks(callbacks, context) {\n const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n return override ? callbacks.override(override) : callbacks;\n}\nclass Tooltip extends Element {\n constructor(config) {\n super();\n this.opacity = 0;\n this._active = [];\n this._eventPosition = undefined;\n this._size = undefined;\n this._cachedAnimations = undefined;\n this._tooltipItems = [];\n this.$animations = undefined;\n this.$context = undefined;\n this.chart = config.chart || config._chart;\n this._chart = this.chart;\n this.options = config.options;\n this.dataPoints = undefined;\n this.title = undefined;\n this.beforeBody = undefined;\n this.body = undefined;\n this.afterBody = undefined;\n this.footer = undefined;\n this.xAlign = undefined;\n this.yAlign = undefined;\n this.x = undefined;\n this.y = undefined;\n this.height = undefined;\n this.width = undefined;\n this.caretX = undefined;\n this.caretY = undefined;\n this.labelColors = undefined;\n this.labelPointStyles = undefined;\n this.labelTextColors = undefined;\n }\n initialize(options) {\n this.options = options;\n this._cachedAnimations = undefined;\n this.$context = undefined;\n }\n _resolveAnimations() {\n const cached = this._cachedAnimations;\n if (cached) {\n return cached;\n }\n const chart = this.chart;\n const options = this.options.setContext(this.getContext());\n const opts = options.enabled && chart.options.animation && options.animations;\n const animations = new Animations(this.chart, opts);\n if (opts._cacheable) {\n this._cachedAnimations = Object.freeze(animations);\n }\n return animations;\n }\n getContext() {\n return this.$context ||\n\t\t\t(this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n }\n getTitle(context, options) {\n const {callbacks} = options;\n const beforeTitle = callbacks.beforeTitle.apply(this, [context]);\n const title = callbacks.title.apply(this, [context]);\n const afterTitle = callbacks.afterTitle.apply(this, [context]);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n lines = pushOrConcat(lines, splitNewlines(title));\n lines = pushOrConcat(lines, splitNewlines(afterTitle));\n return lines;\n }\n getBeforeBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(options.callbacks.beforeBody.apply(this, [tooltipItems]));\n }\n getBody(tooltipItems, options) {\n const {callbacks} = options;\n const bodyItems = [];\n each(tooltipItems, (context) => {\n const bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n const scoped = overrideCallbacks(callbacks, context);\n pushOrConcat(bodyItem.before, splitNewlines(scoped.beforeLabel.call(this, context)));\n pushOrConcat(bodyItem.lines, scoped.label.call(this, context));\n pushOrConcat(bodyItem.after, splitNewlines(scoped.afterLabel.call(this, context)));\n bodyItems.push(bodyItem);\n });\n return bodyItems;\n }\n getAfterBody(tooltipItems, options) {\n return getBeforeAfterBodyLines(options.callbacks.afterBody.apply(this, [tooltipItems]));\n }\n getFooter(tooltipItems, options) {\n const {callbacks} = options;\n const beforeFooter = callbacks.beforeFooter.apply(this, [tooltipItems]);\n const footer = callbacks.footer.apply(this, [tooltipItems]);\n const afterFooter = callbacks.afterFooter.apply(this, [tooltipItems]);\n let lines = [];\n lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n lines = pushOrConcat(lines, splitNewlines(footer));\n lines = pushOrConcat(lines, splitNewlines(afterFooter));\n return lines;\n }\n _createItems(options) {\n const active = this._active;\n const data = this.chart.data;\n const labelColors = [];\n const labelPointStyles = [];\n const labelTextColors = [];\n let tooltipItems = [];\n let i, len;\n for (i = 0, len = active.length; i < len; ++i) {\n tooltipItems.push(createTooltipItem(this.chart, active[i]));\n }\n if (options.filter) {\n tooltipItems = tooltipItems.filter((element, index, array) => options.filter(element, index, array, data));\n }\n if (options.itemSort) {\n tooltipItems = tooltipItems.sort((a, b) => options.itemSort(a, b, data));\n }\n each(tooltipItems, (context) => {\n const scoped = overrideCallbacks(options.callbacks, context);\n labelColors.push(scoped.labelColor.call(this, context));\n labelPointStyles.push(scoped.labelPointStyle.call(this, context));\n labelTextColors.push(scoped.labelTextColor.call(this, context));\n });\n this.labelColors = labelColors;\n this.labelPointStyles = labelPointStyles;\n this.labelTextColors = labelTextColors;\n this.dataPoints = tooltipItems;\n return tooltipItems;\n }\n update(changed, replay) {\n const options = this.options.setContext(this.getContext());\n const active = this._active;\n let properties;\n let tooltipItems = [];\n if (!active.length) {\n if (this.opacity !== 0) {\n properties = {\n opacity: 0\n };\n }\n } else {\n const position = positioners[options.position].call(this, active, this._eventPosition);\n tooltipItems = this._createItems(options);\n this.title = this.getTitle(tooltipItems, options);\n this.beforeBody = this.getBeforeBody(tooltipItems, options);\n this.body = this.getBody(tooltipItems, options);\n this.afterBody = this.getAfterBody(tooltipItems, options);\n this.footer = this.getFooter(tooltipItems, options);\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, size);\n const alignment = determineAlignment(this.chart, options, positionAndSize);\n const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n properties = {\n opacity: 1,\n x: backgroundPoint.x,\n y: backgroundPoint.y,\n width: size.width,\n height: size.height,\n caretX: position.x,\n caretY: position.y\n };\n }\n this._tooltipItems = tooltipItems;\n this.$context = undefined;\n if (properties) {\n this._resolveAnimations().update(this, properties);\n }\n if (changed && options.external) {\n options.external.call(this, {chart: this.chart, tooltip: this, replay});\n }\n }\n drawCaret(tooltipPoint, ctx, size, options) {\n const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n }\n getCaretPosition(tooltipPoint, size, options) {\n const {xAlign, yAlign} = this;\n const {caretSize, cornerRadius} = options;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n const {x: ptX, y: ptY} = tooltipPoint;\n const {width, height} = size;\n let x1, x2, x3, y1, y2, y3;\n if (yAlign === 'center') {\n y2 = ptY + (height / 2);\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n x3 = x1;\n } else {\n if (xAlign === 'left') {\n x2 = ptX + Math.max(topLeft, bottomLeft) + (caretSize);\n } else if (xAlign === 'right') {\n x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n } else {\n x2 = this.caretX;\n }\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n x1 = x2 + caretSize;\n x3 = x2 - caretSize;\n }\n y3 = y1;\n }\n return {x1, x2, x3, y1, y2, y3};\n }\n drawTitle(pt, ctx, options) {\n const title = this.title;\n const length = title.length;\n let titleFont, titleSpacing, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.titleAlign, options);\n ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n ctx.textBaseline = 'middle';\n titleFont = toFont(options.titleFont);\n titleSpacing = options.titleSpacing;\n ctx.fillStyle = options.titleColor;\n ctx.font = titleFont.string;\n for (i = 0; i < length; ++i) {\n ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n pt.y += titleFont.lineHeight + titleSpacing;\n if (i + 1 === length) {\n pt.y += options.titleMarginBottom - titleSpacing;\n }\n }\n }\n }\n _drawColorBox(ctx, pt, i, rtlHelper, options) {\n const labelColors = this.labelColors[i];\n const labelPointStyle = this.labelPointStyles[i];\n const {boxHeight, boxWidth, boxPadding} = options;\n const bodyFont = toFont(options.bodyFont);\n const colorX = getAlignedX(this, 'left', options);\n const rtlColorX = rtlHelper.x(colorX);\n const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n const colorY = pt.y + yOffSet;\n if (options.usePointStyle) {\n const drawOptions = {\n radius: Math.min(boxWidth, boxHeight) / 2,\n pointStyle: labelPointStyle.pointStyle,\n rotation: labelPointStyle.rotation,\n borderWidth: 1\n };\n const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n const centerY = colorY + boxHeight / 2;\n ctx.strokeStyle = options.multiKeyBackground;\n ctx.fillStyle = options.multiKeyBackground;\n drawPoint(ctx, drawOptions, centerX, centerY);\n ctx.strokeStyle = labelColors.borderColor;\n ctx.fillStyle = labelColors.backgroundColor;\n drawPoint(ctx, drawOptions, centerX, centerY);\n } else {\n ctx.lineWidth = labelColors.borderWidth || 1;\n ctx.strokeStyle = labelColors.borderColor;\n ctx.setLineDash(labelColors.borderDash || []);\n ctx.lineDashOffset = labelColors.borderDashOffset || 0;\n const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth - boxPadding);\n const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - boxPadding - 2);\n const borderRadius = toTRBLCorners(labelColors.borderRadius);\n if (Object.values(borderRadius).some(v => v !== 0)) {\n ctx.beginPath();\n ctx.fillStyle = options.multiKeyBackground;\n addRoundedRectPath(ctx, {\n x: outerX,\n y: colorY,\n w: boxWidth,\n h: boxHeight,\n radius: borderRadius,\n });\n ctx.fill();\n ctx.stroke();\n ctx.fillStyle = labelColors.backgroundColor;\n ctx.beginPath();\n addRoundedRectPath(ctx, {\n x: innerX,\n y: colorY + 1,\n w: boxWidth - 2,\n h: boxHeight - 2,\n radius: borderRadius,\n });\n ctx.fill();\n } else {\n ctx.fillStyle = options.multiKeyBackground;\n ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n ctx.fillStyle = labelColors.backgroundColor;\n ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n }\n }\n ctx.fillStyle = this.labelTextColors[i];\n }\n drawBody(pt, ctx, options) {\n const {body} = this;\n const {bodySpacing, bodyAlign, displayColors, boxHeight, boxWidth, boxPadding} = options;\n const bodyFont = toFont(options.bodyFont);\n let bodyLineHeight = bodyFont.lineHeight;\n let xLinePadding = 0;\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n const fillLineOfText = function(line) {\n ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n pt.y += bodyLineHeight + bodySpacing;\n };\n const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n let bodyItem, textColor, lines, i, j, ilen, jlen;\n ctx.textAlign = bodyAlign;\n ctx.textBaseline = 'middle';\n ctx.font = bodyFont.string;\n pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n ctx.fillStyle = options.bodyColor;\n each(this.beforeBody, fillLineOfText);\n xLinePadding = displayColors && bodyAlignForCalculation !== 'right'\n ? bodyAlign === 'center' ? (boxWidth / 2 + boxPadding) : (boxWidth + 2 + boxPadding)\n : 0;\n for (i = 0, ilen = body.length; i < ilen; ++i) {\n bodyItem = body[i];\n textColor = this.labelTextColors[i];\n ctx.fillStyle = textColor;\n each(bodyItem.before, fillLineOfText);\n lines = bodyItem.lines;\n if (displayColors && lines.length) {\n this._drawColorBox(ctx, pt, i, rtlHelper, options);\n bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n }\n for (j = 0, jlen = lines.length; j < jlen; ++j) {\n fillLineOfText(lines[j]);\n bodyLineHeight = bodyFont.lineHeight;\n }\n each(bodyItem.after, fillLineOfText);\n }\n xLinePadding = 0;\n bodyLineHeight = bodyFont.lineHeight;\n each(this.afterBody, fillLineOfText);\n pt.y -= bodySpacing;\n }\n drawFooter(pt, ctx, options) {\n const footer = this.footer;\n const length = footer.length;\n let footerFont, i;\n if (length) {\n const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n pt.x = getAlignedX(this, options.footerAlign, options);\n pt.y += options.footerMarginTop;\n ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n ctx.textBaseline = 'middle';\n footerFont = toFont(options.footerFont);\n ctx.fillStyle = options.footerColor;\n ctx.font = footerFont.string;\n for (i = 0; i < length; ++i) {\n ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n pt.y += footerFont.lineHeight + options.footerSpacing;\n }\n }\n }\n drawBackground(pt, ctx, tooltipSize, options) {\n const {xAlign, yAlign} = this;\n const {x, y} = pt;\n const {width, height} = tooltipSize;\n const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(options.cornerRadius);\n ctx.fillStyle = options.backgroundColor;\n ctx.strokeStyle = options.borderColor;\n ctx.lineWidth = options.borderWidth;\n ctx.beginPath();\n ctx.moveTo(x + topLeft, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width - topRight, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + width, y + height - bottomRight);\n ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x + bottomLeft, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, ctx, tooltipSize, options);\n }\n ctx.lineTo(x, y + topLeft);\n ctx.quadraticCurveTo(x, y, x + topLeft, y);\n ctx.closePath();\n ctx.fill();\n if (options.borderWidth > 0) {\n ctx.stroke();\n }\n }\n _updateAnimationTarget(options) {\n const chart = this.chart;\n const anims = this.$animations;\n const animX = anims && anims.x;\n const animY = anims && anims.y;\n if (animX || animY) {\n const position = positioners[options.position].call(this, this._active, this._eventPosition);\n if (!position) {\n return;\n }\n const size = this._size = getTooltipSize(this, options);\n const positionAndSize = Object.assign({}, position, this._size);\n const alignment = determineAlignment(chart, options, positionAndSize);\n const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n if (animX._to !== point.x || animY._to !== point.y) {\n this.xAlign = alignment.xAlign;\n this.yAlign = alignment.yAlign;\n this.width = size.width;\n this.height = size.height;\n this.caretX = position.x;\n this.caretY = position.y;\n this._resolveAnimations().update(this, point);\n }\n }\n }\n draw(ctx) {\n const options = this.options.setContext(this.getContext());\n let opacity = this.opacity;\n if (!opacity) {\n return;\n }\n this._updateAnimationTarget(options);\n const tooltipSize = {\n width: this.width,\n height: this.height\n };\n const pt = {\n x: this.x,\n y: this.y\n };\n opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n const padding = toPadding(options.padding);\n const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n if (options.enabled && hasTooltipContent) {\n ctx.save();\n ctx.globalAlpha = opacity;\n this.drawBackground(pt, ctx, tooltipSize, options);\n overrideTextDirection(ctx, options.textDirection);\n pt.y += padding.top;\n this.drawTitle(pt, ctx, options);\n this.drawBody(pt, ctx, options);\n this.drawFooter(pt, ctx, options);\n restoreTextDirection(ctx, options.textDirection);\n ctx.restore();\n }\n }\n getActiveElements() {\n return this._active || [];\n }\n setActiveElements(activeElements, eventPosition) {\n const lastActive = this._active;\n const active = activeElements.map(({datasetIndex, index}) => {\n const meta = this.chart.getDatasetMeta(datasetIndex);\n if (!meta) {\n throw new Error('Cannot find a dataset at index ' + datasetIndex);\n }\n return {\n datasetIndex,\n element: meta.data[index],\n index,\n };\n });\n const changed = !_elementsEqual(lastActive, active);\n const positionChanged = this._positionChanged(active, eventPosition);\n if (changed || positionChanged) {\n this._active = active;\n this._eventPosition = eventPosition;\n this._ignoreReplayEvents = true;\n this.update(true);\n }\n }\n handleEvent(e, replay, inChartArea = true) {\n if (replay && this._ignoreReplayEvents) {\n return false;\n }\n this._ignoreReplayEvents = false;\n const options = this.options;\n const lastActive = this._active || [];\n const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n const positionChanged = this._positionChanged(active, e);\n const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n if (changed) {\n this._active = active;\n if (options.enabled || options.external) {\n this._eventPosition = {\n x: e.x,\n y: e.y\n };\n this.update(true, replay);\n }\n }\n return changed;\n }\n _getActiveElements(e, lastActive, replay, inChartArea) {\n const options = this.options;\n if (e.type === 'mouseout') {\n return [];\n }\n if (!inChartArea) {\n return lastActive;\n }\n const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n if (options.reverse) {\n active.reverse();\n }\n return active;\n }\n _positionChanged(active, e) {\n const {caretX, caretY, options} = this;\n const position = positioners[options.position].call(this, active, e);\n return position !== false && (caretX !== position.x || caretY !== position.y);\n }\n}\nTooltip.positioners = positioners;\nvar plugin_tooltip = {\n id: 'tooltip',\n _element: Tooltip,\n positioners,\n afterInit(chart, _args, options) {\n if (options) {\n chart.tooltip = new Tooltip({chart, options});\n }\n },\n beforeUpdate(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n reset(chart, _args, options) {\n if (chart.tooltip) {\n chart.tooltip.initialize(options);\n }\n },\n afterDraw(chart) {\n const tooltip = chart.tooltip;\n const args = {\n tooltip\n };\n if (chart.notifyPlugins('beforeTooltipDraw', args) === false) {\n return;\n }\n if (tooltip) {\n tooltip.draw(chart.ctx);\n }\n chart.notifyPlugins('afterTooltipDraw', args);\n },\n afterEvent(chart, args) {\n if (chart.tooltip) {\n const useFinalPosition = args.replay;\n if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n args.changed = true;\n }\n }\n },\n defaults: {\n enabled: true,\n external: null,\n position: 'average',\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleColor: '#fff',\n titleFont: {\n weight: 'bold',\n },\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleAlign: 'left',\n bodyColor: '#fff',\n bodySpacing: 2,\n bodyFont: {\n },\n bodyAlign: 'left',\n footerColor: '#fff',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFont: {\n weight: 'bold',\n },\n footerAlign: 'left',\n padding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n boxHeight: (ctx, opts) => opts.bodyFont.size,\n boxWidth: (ctx, opts) => opts.bodyFont.size,\n multiKeyBackground: '#fff',\n displayColors: true,\n boxPadding: 0,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n animation: {\n duration: 400,\n easing: 'easeOutQuart',\n },\n animations: {\n numbers: {\n type: 'number',\n properties: ['x', 'y', 'width', 'height', 'caretX', 'caretY'],\n },\n opacity: {\n easing: 'linear',\n duration: 200\n }\n },\n callbacks: {\n beforeTitle: noop,\n title(tooltipItems) {\n if (tooltipItems.length > 0) {\n const item = tooltipItems[0];\n const labels = item.chart.data.labels;\n const labelCount = labels ? labels.length : 0;\n if (this && this.options && this.options.mode === 'dataset') {\n return item.dataset.label || '';\n } else if (item.label) {\n return item.label;\n } else if (labelCount > 0 && item.dataIndex < labelCount) {\n return labels[item.dataIndex];\n }\n }\n return '';\n },\n afterTitle: noop,\n beforeBody: noop,\n beforeLabel: noop,\n label(tooltipItem) {\n if (this && this.options && this.options.mode === 'dataset') {\n return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n }\n let label = tooltipItem.dataset.label || '';\n if (label) {\n label += ': ';\n }\n const value = tooltipItem.formattedValue;\n if (!isNullOrUndef(value)) {\n label += value;\n }\n return label;\n },\n labelColor(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n borderColor: options.borderColor,\n backgroundColor: options.backgroundColor,\n borderWidth: options.borderWidth,\n borderDash: options.borderDash,\n borderDashOffset: options.borderDashOffset,\n borderRadius: 0,\n };\n },\n labelTextColor() {\n return this.options.bodyColor;\n },\n labelPointStyle(tooltipItem) {\n const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n const options = meta.controller.getStyle(tooltipItem.dataIndex);\n return {\n pointStyle: options.pointStyle,\n rotation: options.rotation,\n };\n },\n afterLabel: noop,\n afterBody: noop,\n beforeFooter: noop,\n footer: noop,\n afterFooter: noop\n }\n },\n defaultRoutes: {\n bodyFont: 'font',\n footerFont: 'font',\n titleFont: 'font'\n },\n descriptors: {\n _scriptable: (name) => name !== 'filter' && name !== 'itemSort' && name !== 'external',\n _indexable: false,\n callbacks: {\n _scriptable: false,\n _indexable: false,\n },\n animation: {\n _fallback: false\n },\n animations: {\n _fallback: 'animation'\n }\n },\n additionalOptionScopes: ['interaction']\n};\n\nvar plugins = /*#__PURE__*/Object.freeze({\n__proto__: null,\nDecimation: plugin_decimation,\nFiller: plugin_filler,\nLegend: plugin_legend,\nSubTitle: plugin_subtitle,\nTitle: plugin_title,\nTooltip: plugin_tooltip\n});\n\nconst addIfString = (labels, raw, index, addedLabels) => {\n if (typeof raw === 'string') {\n index = labels.push(raw) - 1;\n addedLabels.unshift({index, label: raw});\n } else if (isNaN(raw)) {\n index = null;\n }\n return index;\n};\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n const first = labels.indexOf(raw);\n if (first === -1) {\n return addIfString(labels, raw, index, addedLabels);\n }\n const last = labels.lastIndexOf(raw);\n return first !== last ? index : first;\n}\nconst validIndex = (index, max) => index === null ? null : _limitValue(Math.round(index), 0, max);\nclass CategoryScale extends Scale {\n constructor(cfg) {\n super(cfg);\n this._startValue = undefined;\n this._valueRange = 0;\n this._addedLabels = [];\n }\n init(scaleOptions) {\n const added = this._addedLabels;\n if (added.length) {\n const labels = this.getLabels();\n for (const {index, label} of added) {\n if (labels[index] === label) {\n labels.splice(index, 1);\n }\n }\n this._addedLabels = [];\n }\n super.init(scaleOptions);\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n const labels = this.getLabels();\n index = isFinite(index) && labels[index] === raw ? index\n : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n return validIndex(index, labels.length - 1);\n }\n determineDataLimits() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this.getMinMax(true);\n if (this.options.bounds === 'ticks') {\n if (!minDefined) {\n min = 0;\n }\n if (!maxDefined) {\n max = this.getLabels().length - 1;\n }\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const min = this.min;\n const max = this.max;\n const offset = this.options.offset;\n const ticks = [];\n let labels = this.getLabels();\n labels = (min === 0 && max === labels.length - 1) ? labels : labels.slice(min, max + 1);\n this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n this._startValue = this.min - (offset ? 0.5 : 0);\n for (let value = min; value <= max; value++) {\n ticks.push({value});\n }\n return ticks;\n }\n getLabelForValue(value) {\n const labels = this.getLabels();\n if (value >= 0 && value < labels.length) {\n return labels[value];\n }\n return value;\n }\n configure() {\n super.configure();\n if (!this.isHorizontal()) {\n this._reversePixels = !this._reversePixels;\n }\n }\n getPixelForValue(value) {\n if (typeof value !== 'number') {\n value = this.parse(value);\n }\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getPixelForTick(index) {\n const ticks = this.ticks;\n if (index < 0 || index > ticks.length - 1) {\n return null;\n }\n return this.getPixelForValue(ticks[index].value);\n }\n getValueForPixel(pixel) {\n return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n }\n getBasePixel() {\n return this.bottom;\n }\n}\nCategoryScale.id = 'category';\nCategoryScale.defaults = {\n ticks: {\n callback: CategoryScale.prototype.getLabelForValue\n }\n};\n\nfunction generateTicks$1(generationOptions, dataRange) {\n const ticks = [];\n const MIN_SPACING = 1e-14;\n const {bounds, step, min, max, precision, count, maxTicks, maxDigits, includeBounds} = generationOptions;\n const unit = step || 1;\n const maxSpaces = maxTicks - 1;\n const {min: rmin, max: rmax} = dataRange;\n const minDefined = !isNullOrUndef(min);\n const maxDefined = !isNullOrUndef(max);\n const countDefined = !isNullOrUndef(count);\n const minSpacing = (rmax - rmin) / (maxDigits + 1);\n let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n let factor, niceMin, niceMax, numSpaces;\n if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n return [{value: rmin}, {value: rmax}];\n }\n numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n if (numSpaces > maxSpaces) {\n spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n }\n if (!isNullOrUndef(precision)) {\n factor = Math.pow(10, precision);\n spacing = Math.ceil(spacing * factor) / factor;\n }\n if (bounds === 'ticks') {\n niceMin = Math.floor(rmin / spacing) * spacing;\n niceMax = Math.ceil(rmax / spacing) * spacing;\n } else {\n niceMin = rmin;\n niceMax = rmax;\n }\n if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n spacing = (max - min) / numSpaces;\n niceMin = min;\n niceMax = max;\n } else if (countDefined) {\n niceMin = minDefined ? min : niceMin;\n niceMax = maxDefined ? max : niceMax;\n numSpaces = count - 1;\n spacing = (niceMax - niceMin) / numSpaces;\n } else {\n numSpaces = (niceMax - niceMin) / spacing;\n if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n }\n const decimalPlaces = Math.max(\n _decimalPlaces(spacing),\n _decimalPlaces(niceMin)\n );\n factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n niceMin = Math.round(niceMin * factor) / factor;\n niceMax = Math.round(niceMax * factor) / factor;\n let j = 0;\n if (minDefined) {\n if (includeBounds && niceMin !== min) {\n ticks.push({value: min});\n if (niceMin < min) {\n j++;\n }\n if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n j++;\n }\n } else if (niceMin < min) {\n j++;\n }\n }\n for (; j < numSpaces; ++j) {\n ticks.push({value: Math.round((niceMin + j * spacing) * factor) / factor});\n }\n if (maxDefined && includeBounds && niceMax !== max) {\n if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n ticks[ticks.length - 1].value = max;\n } else {\n ticks.push({value: max});\n }\n } else if (!maxDefined || niceMax === max) {\n ticks.push({value: niceMax});\n }\n return ticks;\n}\nfunction relativeLabelSize(value, minSpacing, {horizontal, minRotation}) {\n const rad = toRadians(minRotation);\n const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n const length = 0.75 * minSpacing * ('' + value).length;\n return Math.min(minSpacing / ratio, length);\n}\nclass LinearScaleBase extends Scale {\n constructor(cfg) {\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._endValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n if (isNullOrUndef(raw)) {\n return null;\n }\n if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n return null;\n }\n return +raw;\n }\n handleTickRangeOptions() {\n const {beginAtZero} = this.options;\n const {minDefined, maxDefined} = this.getUserBounds();\n let {min, max} = this;\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n if (beginAtZero) {\n const minSign = sign(min);\n const maxSign = sign(max);\n if (minSign < 0 && maxSign < 0) {\n setMax(0);\n } else if (minSign > 0 && maxSign > 0) {\n setMin(0);\n }\n }\n if (min === max) {\n let offset = 1;\n if (max >= Number.MAX_SAFE_INTEGER || min <= Number.MIN_SAFE_INTEGER) {\n offset = Math.abs(max * 0.05);\n }\n setMax(max + offset);\n if (!beginAtZero) {\n setMin(min - offset);\n }\n }\n this.min = min;\n this.max = max;\n }\n getTickLimit() {\n const tickOpts = this.options.ticks;\n let {maxTicksLimit, stepSize} = tickOpts;\n let maxTicks;\n if (stepSize) {\n maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n if (maxTicks > 1000) {\n console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n maxTicks = 1000;\n }\n } else {\n maxTicks = this.computeTickLimit();\n maxTicksLimit = maxTicksLimit || 11;\n }\n if (maxTicksLimit) {\n maxTicks = Math.min(maxTicksLimit, maxTicks);\n }\n return maxTicks;\n }\n computeTickLimit() {\n return Number.POSITIVE_INFINITY;\n }\n buildTicks() {\n const opts = this.options;\n const tickOpts = opts.ticks;\n let maxTicks = this.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n const numericGeneratorOptions = {\n maxTicks,\n bounds: opts.bounds,\n min: opts.min,\n max: opts.max,\n precision: tickOpts.precision,\n step: tickOpts.stepSize,\n count: tickOpts.count,\n maxDigits: this._maxDigits(),\n horizontal: this.isHorizontal(),\n minRotation: tickOpts.minRotation || 0,\n includeBounds: tickOpts.includeBounds !== false\n };\n const dataRange = this._range || this;\n const ticks = generateTicks$1(numericGeneratorOptions, dataRange);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n configure() {\n const ticks = this.ticks;\n let start = this.min;\n let end = this.max;\n super.configure();\n if (this.options.offset && ticks.length) {\n const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n start -= offset;\n end += offset;\n }\n this._startValue = start;\n this._endValue = end;\n this._valueRange = end - start;\n }\n getLabelForValue(value) {\n return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n}\n\nclass LinearScale extends LinearScaleBase {\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n this.min = isNumberFinite(min) ? min : 0;\n this.max = isNumberFinite(max) ? max : 1;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n const horizontal = this.isHorizontal();\n const length = horizontal ? this.width : this.height;\n const minRotation = toRadians(this.options.ticks.minRotation);\n const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n const tickFont = this._resolveTickFontOptions(0);\n return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n }\n getPixelForValue(value) {\n return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n }\n}\nLinearScale.id = 'linear';\nLinearScale.defaults = {\n ticks: {\n callback: Ticks.formatters.numeric\n }\n};\n\nfunction isMajor(tickVal) {\n const remain = tickVal / (Math.pow(10, Math.floor(log10(tickVal))));\n return remain === 1;\n}\nfunction generateTicks(generationOptions, dataRange) {\n const endExp = Math.floor(log10(dataRange.max));\n const endSignificand = Math.ceil(dataRange.max / Math.pow(10, endExp));\n const ticks = [];\n let tickVal = finiteOrDefault(generationOptions.min, Math.pow(10, Math.floor(log10(dataRange.min))));\n let exp = Math.floor(log10(tickVal));\n let significand = Math.floor(tickVal / Math.pow(10, exp));\n let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n do {\n ticks.push({value: tickVal, major: isMajor(tickVal)});\n ++significand;\n if (significand === 10) {\n significand = 1;\n ++exp;\n precision = exp >= 0 ? 1 : precision;\n }\n tickVal = Math.round(significand * Math.pow(10, exp) * precision) / precision;\n } while (exp < endExp || (exp === endExp && significand < endSignificand));\n const lastTick = finiteOrDefault(generationOptions.max, tickVal);\n ticks.push({value: lastTick, major: isMajor(tickVal)});\n return ticks;\n}\nclass LogarithmicScale extends Scale {\n constructor(cfg) {\n super(cfg);\n this.start = undefined;\n this.end = undefined;\n this._startValue = undefined;\n this._valueRange = 0;\n }\n parse(raw, index) {\n const value = LinearScaleBase.prototype.parse.apply(this, [raw, index]);\n if (value === 0) {\n this._zero = true;\n return undefined;\n }\n return isNumberFinite(value) && value > 0 ? value : null;\n }\n determineDataLimits() {\n const {min, max} = this.getMinMax(true);\n this.min = isNumberFinite(min) ? Math.max(0, min) : null;\n this.max = isNumberFinite(max) ? Math.max(0, max) : null;\n if (this.options.beginAtZero) {\n this._zero = true;\n }\n this.handleTickRangeOptions();\n }\n handleTickRangeOptions() {\n const {minDefined, maxDefined} = this.getUserBounds();\n let min = this.min;\n let max = this.max;\n const setMin = v => (min = minDefined ? min : v);\n const setMax = v => (max = maxDefined ? max : v);\n const exp = (v, m) => Math.pow(10, Math.floor(log10(v)) + m);\n if (min === max) {\n if (min <= 0) {\n setMin(1);\n setMax(10);\n } else {\n setMin(exp(min, -1));\n setMax(exp(max, +1));\n }\n }\n if (min <= 0) {\n setMin(exp(max, -1));\n }\n if (max <= 0) {\n setMax(exp(min, +1));\n }\n if (this._zero && this.min !== this._suggestedMin && min === exp(this.min, 0)) {\n setMin(exp(min, -1));\n }\n this.min = min;\n this.max = max;\n }\n buildTicks() {\n const opts = this.options;\n const generationOptions = {\n min: this._userMin,\n max: this._userMax\n };\n const ticks = generateTicks(generationOptions, this);\n if (opts.bounds === 'ticks') {\n _setMinAndMaxByKey(ticks, this, 'value');\n }\n if (opts.reverse) {\n ticks.reverse();\n this.start = this.max;\n this.end = this.min;\n } else {\n this.start = this.min;\n this.end = this.max;\n }\n return ticks;\n }\n getLabelForValue(value) {\n return value === undefined\n ? '0'\n : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n }\n configure() {\n const start = this.min;\n super.configure();\n this._startValue = log10(start);\n this._valueRange = log10(this.max) - log10(start);\n }\n getPixelForValue(value) {\n if (value === undefined || value === 0) {\n value = this.min;\n }\n if (value === null || isNaN(value)) {\n return NaN;\n }\n return this.getPixelForDecimal(value === this.min\n ? 0\n : (log10(value) - this._startValue) / this._valueRange);\n }\n getValueForPixel(pixel) {\n const decimal = this.getDecimalForPixel(pixel);\n return Math.pow(10, this._startValue + decimal * this._valueRange);\n }\n}\nLogarithmicScale.id = 'logarithmic';\nLogarithmicScale.defaults = {\n ticks: {\n callback: Ticks.formatters.logarithmic,\n major: {\n enabled: true\n }\n }\n};\n\nfunction getTickBackdropHeight(opts) {\n const tickOpts = opts.ticks;\n if (tickOpts.display && opts.display) {\n const padding = toPadding(tickOpts.backdropPadding);\n return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n }\n return 0;\n}\nfunction measureLabelSize(ctx, font, label) {\n label = isArray(label) ? label : [label];\n return {\n w: _longestText(ctx, font.string, label),\n h: label.length * font.lineHeight\n };\n}\nfunction determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - (size / 2),\n end: pos + (size / 2)\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size,\n end: pos\n };\n }\n return {\n start: pos,\n end: pos + size\n };\n}\nfunction fitWithPointLabels(scale) {\n const orig = {\n l: scale.left + scale._padding.left,\n r: scale.right - scale._padding.right,\n t: scale.top + scale._padding.top,\n b: scale.bottom - scale._padding.bottom\n };\n const limits = Object.assign({}, orig);\n const labelSizes = [];\n const padding = [];\n const valueCount = scale._pointLabels.length;\n const pointLabelOpts = scale.options.pointLabels;\n const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n for (let i = 0; i < valueCount; i++) {\n const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n padding[i] = opts.padding;\n const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n const plFont = toFont(opts.font);\n const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n labelSizes[i] = textSize;\n const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n const angle = Math.round(toDegrees(angleRadians));\n const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n }\n scale.setCenterPoint(\n orig.l - limits.l,\n limits.r - orig.r,\n orig.t - limits.t,\n limits.b - orig.b\n );\n scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n const sin = Math.abs(Math.sin(angle));\n const cos = Math.abs(Math.cos(angle));\n let x = 0;\n let y = 0;\n if (hLimits.start < orig.l) {\n x = (orig.l - hLimits.start) / sin;\n limits.l = Math.min(limits.l, orig.l - x);\n } else if (hLimits.end > orig.r) {\n x = (hLimits.end - orig.r) / sin;\n limits.r = Math.max(limits.r, orig.r + x);\n }\n if (vLimits.start < orig.t) {\n y = (orig.t - vLimits.start) / cos;\n limits.t = Math.min(limits.t, orig.t - y);\n } else if (vLimits.end > orig.b) {\n y = (vLimits.end - orig.b) / cos;\n limits.b = Math.max(limits.b, orig.b + y);\n }\n}\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n const items = [];\n const valueCount = scale._pointLabels.length;\n const opts = scale.options;\n const extra = getTickBackdropHeight(opts) / 2;\n const outerDistance = scale.drawingArea;\n const additionalAngle = opts.pointLabels.centerPointLabels ? PI / valueCount : 0;\n for (let i = 0; i < valueCount; i++) {\n const pointLabelPosition = scale.getPointPosition(i, outerDistance + extra + padding[i], additionalAngle);\n const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n const size = labelSizes[i];\n const y = yForAngle(pointLabelPosition.y, size.h, angle);\n const textAlign = getTextAlignForAngle(angle);\n const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n items.push({\n x: pointLabelPosition.x,\n y,\n textAlign,\n left,\n top: y,\n right: left + size.w,\n bottom: y + size.h\n });\n }\n return items;\n}\nfunction getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n return 'right';\n}\nfunction leftForTextAlign(x, w, align) {\n if (align === 'right') {\n x -= w;\n } else if (align === 'center') {\n x -= (w / 2);\n }\n return x;\n}\nfunction yForAngle(y, h, angle) {\n if (angle === 90 || angle === 270) {\n y -= (h / 2);\n } else if (angle > 270 || angle < 90) {\n y -= h;\n }\n return y;\n}\nfunction drawPointLabels(scale, labelCount) {\n const {ctx, options: {pointLabels}} = scale;\n for (let i = labelCount - 1; i >= 0; i--) {\n const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n const plFont = toFont(optsAtIndex.font);\n const {x, y, textAlign, left, top, right, bottom} = scale._pointLabelItems[i];\n const {backdropColor} = optsAtIndex;\n if (!isNullOrUndef(backdropColor)) {\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillStyle = backdropColor;\n ctx.fillRect(left - padding.left, top - padding.top, right - left + padding.width, bottom - top + padding.height);\n }\n renderText(\n ctx,\n scale._pointLabels[i],\n x,\n y + (plFont.lineHeight / 2),\n plFont,\n {\n color: optsAtIndex.color,\n textAlign: textAlign,\n textBaseline: 'middle'\n }\n );\n }\n}\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n const {ctx} = scale;\n if (circular) {\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n } else {\n let pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n for (let i = 1; i < labelCount; i++) {\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n }\n}\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount) {\n const ctx = scale.ctx;\n const circular = gridLineOpts.circular;\n const {color, lineWidth} = gridLineOpts;\n if ((!circular && !labelCount) || !color || !lineWidth || radius < 0) {\n return;\n }\n ctx.save();\n ctx.strokeStyle = color;\n ctx.lineWidth = lineWidth;\n ctx.setLineDash(gridLineOpts.borderDash);\n ctx.lineDashOffset = gridLineOpts.borderDashOffset;\n ctx.beginPath();\n pathRadiusLine(scale, radius, circular, labelCount);\n ctx.closePath();\n ctx.stroke();\n ctx.restore();\n}\nfunction createPointLabelContext(parent, index, label) {\n return createContext(parent, {\n label,\n index,\n type: 'pointLabel'\n });\n}\nclass RadialLinearScale extends LinearScaleBase {\n constructor(cfg) {\n super(cfg);\n this.xCenter = undefined;\n this.yCenter = undefined;\n this.drawingArea = undefined;\n this._pointLabels = [];\n this._pointLabelItems = [];\n }\n setDimensions() {\n const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n const w = this.width = this.maxWidth - padding.width;\n const h = this.height = this.maxHeight - padding.height;\n this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n this.drawingArea = Math.floor(Math.min(w, h) / 2);\n }\n determineDataLimits() {\n const {min, max} = this.getMinMax(false);\n this.min = isNumberFinite(min) && !isNaN(min) ? min : 0;\n this.max = isNumberFinite(max) && !isNaN(max) ? max : 0;\n this.handleTickRangeOptions();\n }\n computeTickLimit() {\n return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n }\n generateTickLabels(ticks) {\n LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n this._pointLabels = this.getLabels()\n .map((value, index) => {\n const label = callback(this.options.pointLabels.callback, [value, index], this);\n return label || label === 0 ? label : '';\n })\n .filter((v, i) => this.chart.getDataVisibility(i));\n }\n fit() {\n const opts = this.options;\n if (opts.display && opts.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n this.setCenterPoint(0, 0, 0, 0);\n }\n }\n setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n }\n getIndexAngle(index) {\n const angleMultiplier = TAU / (this._pointLabels.length || 1);\n const startAngle = this.options.startAngle || 0;\n return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n }\n getDistanceFromCenterForValue(value) {\n if (isNullOrUndef(value)) {\n return NaN;\n }\n const scalingFactor = this.drawingArea / (this.max - this.min);\n if (this.options.reverse) {\n return (this.max - value) * scalingFactor;\n }\n return (value - this.min) * scalingFactor;\n }\n getValueForDistanceFromCenter(distance) {\n if (isNullOrUndef(distance)) {\n return NaN;\n }\n const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n }\n getPointLabelContext(index) {\n const pointLabels = this._pointLabels || [];\n if (index >= 0 && index < pointLabels.length) {\n const pointLabel = pointLabels[index];\n return createPointLabelContext(this.getContext(), index, pointLabel);\n }\n }\n getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n return {\n x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n angle\n };\n }\n getPointPositionForValue(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n }\n getBasePosition(index) {\n return this.getPointPositionForValue(index || 0, this.getBaseValue());\n }\n getPointLabelPosition(index) {\n const {left, top, right, bottom} = this._pointLabelItems[index];\n return {\n left,\n top,\n right,\n bottom,\n };\n }\n drawBackground() {\n const {backgroundColor, grid: {circular}} = this.options;\n if (backgroundColor) {\n const ctx = this.ctx;\n ctx.save();\n ctx.beginPath();\n pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n ctx.closePath();\n ctx.fillStyle = backgroundColor;\n ctx.fill();\n ctx.restore();\n }\n }\n drawGrid() {\n const ctx = this.ctx;\n const opts = this.options;\n const {angleLines, grid} = opts;\n const labelCount = this._pointLabels.length;\n let i, offset, position;\n if (opts.pointLabels.display) {\n drawPointLabels(this, labelCount);\n }\n if (grid.display) {\n this.ticks.forEach((tick, index) => {\n if (index !== 0) {\n offset = this.getDistanceFromCenterForValue(tick.value);\n const optsAtIndex = grid.setContext(this.getContext(index - 1));\n drawRadiusLine(this, optsAtIndex, offset, labelCount);\n }\n });\n }\n if (angleLines.display) {\n ctx.save();\n for (i = labelCount - 1; i >= 0; i--) {\n const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n const {color, lineWidth} = optsAtIndex;\n if (!lineWidth || !color) {\n continue;\n }\n ctx.lineWidth = lineWidth;\n ctx.strokeStyle = color;\n ctx.setLineDash(optsAtIndex.borderDash);\n ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n position = this.getPointPosition(i, offset);\n ctx.beginPath();\n ctx.moveTo(this.xCenter, this.yCenter);\n ctx.lineTo(position.x, position.y);\n ctx.stroke();\n }\n ctx.restore();\n }\n }\n drawBorder() {}\n drawLabels() {\n const ctx = this.ctx;\n const opts = this.options;\n const tickOpts = opts.ticks;\n if (!tickOpts.display) {\n return;\n }\n const startAngle = this.getIndexAngle(0);\n let offset, width;\n ctx.save();\n ctx.translate(this.xCenter, this.yCenter);\n ctx.rotate(startAngle);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n this.ticks.forEach((tick, index) => {\n if (index === 0 && !opts.reverse) {\n return;\n }\n const optsAtIndex = tickOpts.setContext(this.getContext(index));\n const tickFont = toFont(optsAtIndex.font);\n offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n if (optsAtIndex.showLabelBackdrop) {\n ctx.font = tickFont.string;\n width = ctx.measureText(tick.label).width;\n ctx.fillStyle = optsAtIndex.backdropColor;\n const padding = toPadding(optsAtIndex.backdropPadding);\n ctx.fillRect(\n -width / 2 - padding.left,\n -offset - tickFont.size / 2 - padding.top,\n width + padding.width,\n tickFont.size + padding.height\n );\n }\n renderText(ctx, tick.label, 0, -offset, tickFont, {\n color: optsAtIndex.color,\n });\n });\n ctx.restore();\n }\n drawTitle() {}\n}\nRadialLinearScale.id = 'radialLinear';\nRadialLinearScale.defaults = {\n display: true,\n animate: true,\n position: 'chartArea',\n angleLines: {\n display: true,\n lineWidth: 1,\n borderDash: [],\n borderDashOffset: 0.0\n },\n grid: {\n circular: false\n },\n startAngle: 0,\n ticks: {\n showLabelBackdrop: true,\n callback: Ticks.formatters.numeric\n },\n pointLabels: {\n backdropColor: undefined,\n backdropPadding: 2,\n display: true,\n font: {\n size: 10\n },\n callback(label) {\n return label;\n },\n padding: 5,\n centerPointLabels: false\n }\n};\nRadialLinearScale.defaultRoutes = {\n 'angleLines.color': 'borderColor',\n 'pointLabels.color': 'color',\n 'ticks.color': 'color'\n};\nRadialLinearScale.descriptors = {\n angleLines: {\n _fallback: 'grid'\n }\n};\n\nconst INTERVALS = {\n millisecond: {common: true, size: 1, steps: 1000},\n second: {common: true, size: 1000, steps: 60},\n minute: {common: true, size: 60000, steps: 60},\n hour: {common: true, size: 3600000, steps: 24},\n day: {common: true, size: 86400000, steps: 30},\n week: {common: false, size: 604800000, steps: 4},\n month: {common: true, size: 2.628e9, steps: 12},\n quarter: {common: false, size: 7.884e9, steps: 4},\n year: {common: true, size: 3.154e10}\n};\nconst UNITS = (Object.keys(INTERVALS));\nfunction sorter(a, b) {\n return a - b;\n}\nfunction parse(scale, input) {\n if (isNullOrUndef(input)) {\n return null;\n }\n const adapter = scale._adapter;\n const {parser, round, isoWeekday} = scale._parseOpts;\n let value = input;\n if (typeof parser === 'function') {\n value = parser(value);\n }\n if (!isNumberFinite(value)) {\n value = typeof parser === 'string'\n ? adapter.parse(value, parser)\n : adapter.parse(value);\n }\n if (value === null) {\n return null;\n }\n if (round) {\n value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true)\n ? adapter.startOf(value, 'isoWeek', isoWeekday)\n : adapter.startOf(value, round);\n }\n return +value;\n}\nfunction determineUnitForAutoTicks(minUnit, min, max, capacity) {\n const ilen = UNITS.length;\n for (let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {\n const interval = INTERVALS[UNITS[i]];\n const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n return UNITS[ilen - 1];\n}\nfunction determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n for (let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--) {\n const unit = UNITS[i];\n if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n return unit;\n }\n }\n return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\nfunction determineMajorUnit(unit) {\n for (let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {\n if (INTERVALS[UNITS[i]].common) {\n return UNITS[i];\n }\n }\n}\nfunction addTick(ticks, time, timestamps) {\n if (!timestamps) {\n ticks[time] = true;\n } else if (timestamps.length) {\n const {lo, hi} = _lookup(timestamps, time);\n const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n ticks[timestamp] = true;\n }\n}\nfunction setMajorTicks(scale, ticks, map, majorUnit) {\n const adapter = scale._adapter;\n const first = +adapter.startOf(ticks[0].value, majorUnit);\n const last = ticks[ticks.length - 1].value;\n let major, index;\n for (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) {\n index = map[major];\n if (index >= 0) {\n ticks[index].major = true;\n }\n }\n return ticks;\n}\nfunction ticksFromTimestamps(scale, values, majorUnit) {\n const ticks = [];\n const map = {};\n const ilen = values.length;\n let i, value;\n for (i = 0; i < ilen; ++i) {\n value = values[i];\n map[value] = i;\n ticks.push({\n value,\n major: false\n });\n }\n return (ilen === 0 || !majorUnit) ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\nclass TimeScale extends Scale {\n constructor(props) {\n super(props);\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n this._unit = 'day';\n this._majorUnit = undefined;\n this._offsets = {};\n this._normalized = false;\n this._parseOpts = undefined;\n }\n init(scaleOpts, opts) {\n const time = scaleOpts.time || (scaleOpts.time = {});\n const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n mergeIf(time.displayFormats, adapter.formats());\n this._parseOpts = {\n parser: time.parser,\n round: time.round,\n isoWeekday: time.isoWeekday\n };\n super.init(scaleOpts);\n this._normalized = opts.normalized;\n }\n parse(raw, index) {\n if (raw === undefined) {\n return null;\n }\n return parse(this, raw);\n }\n beforeLayout() {\n super.beforeLayout();\n this._cache = {\n data: [],\n labels: [],\n all: []\n };\n }\n determineDataLimits() {\n const options = this.options;\n const adapter = this._adapter;\n const unit = options.time.unit || 'day';\n let {min, max, minDefined, maxDefined} = this.getUserBounds();\n function _applyBounds(bounds) {\n if (!minDefined && !isNaN(bounds.min)) {\n min = Math.min(min, bounds.min);\n }\n if (!maxDefined && !isNaN(bounds.max)) {\n max = Math.max(max, bounds.max);\n }\n }\n if (!minDefined || !maxDefined) {\n _applyBounds(this._getLabelBounds());\n if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n _applyBounds(this.getMinMax(false));\n }\n }\n min = isNumberFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n max = isNumberFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n this.min = Math.min(min, max - 1);\n this.max = Math.max(min + 1, max);\n }\n _getLabelBounds() {\n const arr = this.getLabelTimestamps();\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n if (arr.length) {\n min = arr[0];\n max = arr[arr.length - 1];\n }\n return {min, max};\n }\n buildTicks() {\n const options = this.options;\n const timeOpts = options.time;\n const tickOpts = options.ticks;\n const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n if (options.bounds === 'ticks' && timestamps.length) {\n this.min = this._userMin || timestamps[0];\n this.max = this._userMax || timestamps[timestamps.length - 1];\n }\n const min = this.min;\n const max = this.max;\n const ticks = _filterBetween(timestamps, min, max);\n this._unit = timeOpts.unit || (tickOpts.autoSkip\n ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min))\n : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined\n : determineMajorUnit(this._unit);\n this.initOffsets(timestamps);\n if (options.reverse) {\n ticks.reverse();\n }\n return ticksFromTimestamps(this, ticks, this._majorUnit);\n }\n initOffsets(timestamps) {\n let start = 0;\n let end = 0;\n let first, last;\n if (this.options.offset && timestamps.length) {\n first = this.getDecimalForValue(timestamps[0]);\n if (timestamps.length === 1) {\n start = 1 - first;\n } else {\n start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n }\n last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n if (timestamps.length === 1) {\n end = last;\n } else {\n end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n }\n }\n const limit = timestamps.length < 3 ? 0.5 : 0.25;\n start = _limitValue(start, 0, limit);\n end = _limitValue(end, 0, limit);\n this._offsets = {start, end, factor: 1 / (start + 1 + end)};\n }\n _generate() {\n const adapter = this._adapter;\n const min = this.min;\n const max = this.max;\n const options = this.options;\n const timeOpts = options.time;\n const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n const stepSize = valueOrDefault(timeOpts.stepSize, 1);\n const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n const hasWeekday = isNumber(weekday) || weekday === true;\n const ticks = {};\n let first = min;\n let time, count;\n if (hasWeekday) {\n first = +adapter.startOf(first, 'isoWeek', weekday);\n }\n first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n }\n const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n for (time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++) {\n addTick(ticks, time, timestamps);\n }\n if (time === max || options.bounds === 'ticks' || count === 1) {\n addTick(ticks, time, timestamps);\n }\n return Object.keys(ticks).sort((a, b) => a - b).map(x => +x);\n }\n getLabelForValue(value) {\n const adapter = this._adapter;\n const timeOpts = this.options.time;\n if (timeOpts.tooltipFormat) {\n return adapter.format(value, timeOpts.tooltipFormat);\n }\n return adapter.format(value, timeOpts.displayFormats.datetime);\n }\n _tickFormatFunction(time, index, ticks, format) {\n const options = this.options;\n const formats = options.time.displayFormats;\n const unit = this._unit;\n const majorUnit = this._majorUnit;\n const minorFormat = unit && formats[unit];\n const majorFormat = majorUnit && formats[majorUnit];\n const tick = ticks[index];\n const major = majorUnit && majorFormat && tick && tick.major;\n const label = this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n const formatter = options.ticks.callback;\n return formatter ? callback(formatter, [label, index, ticks], this) : label;\n }\n generateTickLabels(ticks) {\n let i, ilen, tick;\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n tick = ticks[i];\n tick.label = this._tickFormatFunction(tick.value, i, ticks);\n }\n }\n getDecimalForValue(value) {\n return value === null ? NaN : (value - this.min) / (this.max - this.min);\n }\n getPixelForValue(value) {\n const offsets = this._offsets;\n const pos = this.getDecimalForValue(value);\n return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return this.min + pos * (this.max - this.min);\n }\n _getLabelSize(label) {\n const ticksOpts = this.options.ticks;\n const tickLabelWidth = this.ctx.measureText(label).width;\n const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n const cosRotation = Math.cos(angle);\n const sinRotation = Math.sin(angle);\n const tickFontSize = this._resolveTickFontOptions(0).size;\n return {\n w: (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation),\n h: (tickLabelWidth * sinRotation) + (tickFontSize * cosRotation)\n };\n }\n _getLabelCapacity(exampleTime) {\n const timeOpts = this.options.time;\n const displayFormats = timeOpts.displayFormats;\n const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [exampleTime], this._majorUnit), format);\n const size = this._getLabelSize(exampleLabel);\n const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n return capacity > 0 ? capacity : 1;\n }\n getDataTimestamps() {\n let timestamps = this._cache.data || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const metas = this.getMatchingVisibleMetas();\n if (this._normalized && metas.length) {\n return (this._cache.data = metas[0].controller.getAllParsedValues(this));\n }\n for (i = 0, ilen = metas.length; i < ilen; ++i) {\n timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n }\n return (this._cache.data = this.normalize(timestamps));\n }\n getLabelTimestamps() {\n const timestamps = this._cache.labels || [];\n let i, ilen;\n if (timestamps.length) {\n return timestamps;\n }\n const labels = this.getLabels();\n for (i = 0, ilen = labels.length; i < ilen; ++i) {\n timestamps.push(parse(this, labels[i]));\n }\n return (this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps));\n }\n normalize(values) {\n return _arrayUnique(values.sort(sorter));\n }\n}\nTimeScale.id = 'time';\nTimeScale.defaults = {\n bounds: 'data',\n adapters: {},\n time: {\n parser: false,\n unit: false,\n round: false,\n isoWeekday: false,\n minUnit: 'millisecond',\n displayFormats: {}\n },\n ticks: {\n source: 'auto',\n major: {\n enabled: false\n }\n }\n};\n\nfunction interpolate(table, val, reverse) {\n let lo = 0;\n let hi = table.length - 1;\n let prevSource, nextSource, prevTarget, nextTarget;\n if (reverse) {\n if (val >= table[lo].pos && val <= table[hi].pos) {\n ({lo, hi} = _lookupByKey(table, 'pos', val));\n }\n ({pos: prevSource, time: prevTarget} = table[lo]);\n ({pos: nextSource, time: nextTarget} = table[hi]);\n } else {\n if (val >= table[lo].time && val <= table[hi].time) {\n ({lo, hi} = _lookupByKey(table, 'time', val));\n }\n ({time: prevSource, pos: prevTarget} = table[lo]);\n ({time: nextSource, pos: nextTarget} = table[hi]);\n }\n const span = nextSource - prevSource;\n return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\nclass TimeSeriesScale extends TimeScale {\n constructor(props) {\n super(props);\n this._table = [];\n this._minPos = undefined;\n this._tableRange = undefined;\n }\n initOffsets() {\n const timestamps = this._getTimestampsForTable();\n const table = this._table = this.buildLookupTable(timestamps);\n this._minPos = interpolate(table, this.min);\n this._tableRange = interpolate(table, this.max) - this._minPos;\n super.initOffsets(timestamps);\n }\n buildLookupTable(timestamps) {\n const {min, max} = this;\n const items = [];\n const table = [];\n let i, ilen, prev, curr, next;\n for (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n curr = timestamps[i];\n if (curr >= min && curr <= max) {\n items.push(curr);\n }\n }\n if (items.length < 2) {\n return [\n {time: min, pos: 0},\n {time: max, pos: 1}\n ];\n }\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n if (Math.round((next + prev) / 2) !== curr) {\n table.push({time: curr, pos: i / (ilen - 1)});\n }\n }\n return table;\n }\n _getTimestampsForTable() {\n let timestamps = this._cache.all || [];\n if (timestamps.length) {\n return timestamps;\n }\n const data = this.getDataTimestamps();\n const label = this.getLabelTimestamps();\n if (data.length && label.length) {\n timestamps = this.normalize(data.concat(label));\n } else {\n timestamps = data.length ? data : label;\n }\n timestamps = this._cache.all = timestamps;\n return timestamps;\n }\n getDecimalForValue(value) {\n return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n }\n getValueForPixel(pixel) {\n const offsets = this._offsets;\n const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n }\n}\nTimeSeriesScale.id = 'timeseries';\nTimeSeriesScale.defaults = TimeScale.defaults;\n\nvar scales = /*#__PURE__*/Object.freeze({\n__proto__: null,\nCategoryScale: CategoryScale,\nLinearScale: LinearScale,\nLogarithmicScale: LogarithmicScale,\nRadialLinearScale: RadialLinearScale,\nTimeScale: TimeScale,\nTimeSeriesScale: TimeSeriesScale\n});\n\nconst registerables = [\n controllers,\n elements,\n plugins,\n scales,\n];\n\nexport { Animation, Animations, ArcElement, BarController, BarElement, BasePlatform, BasicPlatform, BubbleController, CategoryScale, Chart, DatasetController, plugin_decimation as Decimation, DomPlatform, DoughnutController, Element, plugin_filler as Filler, Interaction, plugin_legend as Legend, LineController, LineElement, LinearScale, LogarithmicScale, PieController, PointElement, PolarAreaController, RadarController, RadialLinearScale, Scale, ScatterController, plugin_subtitle as SubTitle, Ticks, TimeScale, TimeSeriesScale, plugin_title as Title, plugin_tooltip as Tooltip, adapters as _adapters, _detectPlatform, animator, controllers, elements, layouts, plugins, registerables, registry, scales };\n","import type { MouseEvent } from 'react';\nimport type {\n ChartType,\n ChartData,\n DefaultDataPoint,\n ChartDataset,\n ChartOptions,\n Chart,\n} from 'chart.js';\n\nimport type { ForwardedRef } from './types';\n\nconst defaultDatasetIdKey = 'label';\n\nexport function reforwardRef(ref: ForwardedRef, value: T) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}\n\nexport function setOptions<\n TType extends ChartType = ChartType,\n TData = DefaultDataPoint,\n TLabel = unknown\n>(chart: Chart, nextOptions: ChartOptions) {\n chart.options = { ...nextOptions };\n}\n\nexport function setLabels<\n TType extends ChartType = ChartType,\n TData = DefaultDataPoint,\n TLabel = unknown\n>(\n currentData: ChartData,\n nextLabels: TLabel[] | undefined\n) {\n currentData.labels = nextLabels;\n}\n\nexport function setDatasets<\n TType extends ChartType = ChartType,\n TData = DefaultDataPoint,\n TLabel = unknown\n>(\n currentData: ChartData,\n nextDatasets: ChartDataset[],\n datasetIdKey = defaultDatasetIdKey\n) {\n const addedDatasets: ChartDataset[] = [];\n\n currentData.datasets = nextDatasets.map(\n (nextDataset: Record) => {\n // given the new set, find it's current match\n const currentDataset = currentData.datasets.find(\n (dataset: Record) =>\n dataset[datasetIdKey] === nextDataset[datasetIdKey]\n );\n\n // There is no original to update, so simply add new one\n if (\n !currentDataset ||\n !nextDataset.data ||\n addedDatasets.includes(currentDataset)\n ) {\n return { ...nextDataset } as ChartDataset;\n }\n\n addedDatasets.push(currentDataset);\n\n Object.assign(currentDataset, nextDataset);\n\n return currentDataset;\n }\n );\n}\n\nexport function cloneData<\n TType extends ChartType = ChartType,\n TData = DefaultDataPoint,\n TLabel = unknown\n>(data: ChartData, datasetIdKey = defaultDatasetIdKey) {\n const nextData: ChartData = {\n labels: [],\n datasets: [],\n };\n\n setLabels(nextData, data.labels);\n setDatasets(nextData, data.datasets, datasetIdKey);\n\n return nextData;\n}\n\n/**\n * Get dataset from mouse click event\n * @param chart - Chart.js instance\n * @param event - Mouse click event\n * @returns Dataset\n */\nexport function getDatasetAtEvent(\n chart: Chart,\n event: MouseEvent\n) {\n return chart.getElementsAtEventForMode(\n event.nativeEvent,\n 'dataset',\n { intersect: true },\n false\n );\n}\n\n/**\n * Get single dataset element from mouse click event\n * @param chart - Chart.js instance\n * @param event - Mouse click event\n * @returns Dataset\n */\nexport function getElementAtEvent(\n chart: Chart,\n event: MouseEvent\n) {\n return chart.getElementsAtEventForMode(\n event.nativeEvent,\n 'nearest',\n { intersect: true },\n false\n );\n}\n\n/**\n * Get all dataset elements from mouse click event\n * @param chart - Chart.js instance\n * @param event - Mouse click event\n * @returns Dataset\n */\nexport function getElementsAtEvent(\n chart: Chart,\n event: MouseEvent\n) {\n return chart.getElementsAtEventForMode(\n event.nativeEvent,\n 'index',\n { intersect: true },\n false\n );\n}\n","import React, { useEffect, useRef, forwardRef } from 'react';\nimport { Chart as ChartJS } from 'chart.js';\nimport type { ChartType, DefaultDataPoint } from 'chart.js';\n\nimport type { ForwardedRef, ChartProps, TypedChartComponent } from './types';\nimport {\n reforwardRef,\n cloneData,\n setOptions,\n setLabels,\n setDatasets,\n} from './utils';\n\nfunction ChartComponent<\n TType extends ChartType = ChartType,\n TData = DefaultDataPoint,\n TLabel = unknown\n>(\n {\n height = 150,\n width = 300,\n redraw = false,\n datasetIdKey,\n type,\n data,\n options,\n plugins = [],\n fallbackContent,\n ...props\n }: ChartProps,\n ref: ForwardedRef>\n) {\n type TypedChartJS = ChartJS;\n\n const canvasRef = useRef(null);\n const chartRef = useRef();\n\n const renderChart = () => {\n if (!canvasRef.current) return;\n\n chartRef.current = new ChartJS(canvasRef.current, {\n type,\n data: cloneData(data, datasetIdKey),\n options,\n plugins,\n });\n\n reforwardRef(ref, chartRef.current);\n };\n\n const destroyChart = () => {\n reforwardRef(ref, null);\n\n if (chartRef.current) {\n chartRef.current.destroy();\n chartRef.current = null;\n }\n };\n\n useEffect(() => {\n if (!redraw && chartRef.current && options) {\n setOptions(chartRef.current, options);\n }\n }, [redraw, options]);\n\n useEffect(() => {\n if (!redraw && chartRef.current) {\n setLabels(chartRef.current.config.data, data.labels);\n }\n }, [redraw, data.labels]);\n\n useEffect(() => {\n if (!redraw && chartRef.current && data.datasets) {\n setDatasets(chartRef.current.config.data, data.datasets, datasetIdKey);\n }\n }, [redraw, data.datasets]);\n\n useEffect(() => {\n if (!chartRef.current) return;\n\n if (redraw) {\n destroyChart();\n setTimeout(renderChart);\n } else {\n chartRef.current.update();\n }\n }, [redraw, options, data.labels, data.datasets]);\n\n useEffect(() => {\n renderChart();\n\n return () => destroyChart();\n }, []);\n\n return (\n \n {fallbackContent}\n \n );\n}\n\nexport const Chart = forwardRef(ChartComponent) as TypedChartComponent;\n","import React, { forwardRef } from 'react';\nimport {\n Chart as ChartJS,\n LineController,\n BarController,\n RadarController,\n DoughnutController,\n PolarAreaController,\n BubbleController,\n PieController,\n ScatterController,\n} from 'chart.js';\nimport type { ChartType, ChartComponentLike } from 'chart.js';\n\nimport type {\n ChartProps,\n ChartJSOrUndefined,\n TypedChartComponent,\n} from './types';\nimport { Chart } from './chart';\n\nfunction createTypedChart(\n type: T,\n registerables: ChartComponentLike\n) {\n ChartJS.register(registerables);\n\n return forwardRef, Omit, 'type'>>(\n (props, ref) => \n ) as TypedChartComponent;\n}\n\nexport const Line = /* #__PURE__ */ createTypedChart('line', LineController);\n\nexport const Bar = /* #__PURE__ */ createTypedChart('bar', BarController);\n\nexport const Radar = /* #__PURE__ */ createTypedChart('radar', RadarController);\n\nexport const Doughnut = /* #__PURE__ */ createTypedChart(\n 'doughnut',\n DoughnutController\n);\n\nexport const PolarArea = /* #__PURE__ */ createTypedChart(\n 'polarArea',\n PolarAreaController\n);\n\nexport const Bubble = /* #__PURE__ */ createTypedChart(\n 'bubble',\n BubbleController\n);\n\nexport const Pie = /* #__PURE__ */ createTypedChart('pie', PieController);\n\nexport const Scatter = /* #__PURE__ */ createTypedChart(\n 'scatter',\n ScatterController\n);\n","// hooks/dependencies\nimport React, { useState, useEffect } from 'react';\nimport {\n Chart as ChartJS,\n CategoryScale,\n LinearScale,\n BarElement,\n Title,\n Tooltip,\n} from 'chart.js';\nimport { Bar } from 'react-chartjs-2';\n\nChartJS.register(CategoryScale, LinearScale, BarElement, Title, Tooltip);\n\ninterface Props {\n data: any;\n}\n\nexport const InteractionTypeGene: React.FC = ({ data }) => {\n const [chartData, setChartData] = useState({\n labels: ['inhibitor', 'antagonist', 'antibody', 'agonist'],\n datasets: [\n {\n label: '',\n data: [0, 0, 0, 0],\n backgroundColor: [\n '#480A77',\n '#8075FF',\n '#89E8F1',\n '#FA198B',\n '#4BC6B9',\n '#F0EFF4',\n '#D1CFE2',\n '#BAA898',\n ],\n },\n ],\n });\n\n const options = {\n responsive: true,\n maintainAspectRatio: false,\n plugins: {\n legend: {\n display: false,\n },\n title: {\n display: true,\n text: 'Interaction Type',\n },\n },\n };\n\n const labels = ['inhibitor', 'antagonist', 'antibody', 'agonist'];\n\n useEffect(() => {\n if (data?.length) {\n let dataArray = [0, 0, 0, 0];\n data.forEach((gene: any) => {\n gene.interactions.forEach((int: any) => {\n if (int.interactionTypes.length) {\n switch (int.interactionTypes[0].type) {\n case 'inhibitor':\n dataArray[0]++;\n break;\n case 'antagonist':\n dataArray[1]++;\n break;\n case 'antibody':\n dataArray[2]++;\n break;\n case 'agonist':\n dataArray[3]++;\n break;\n default:\n return;\n }\n }\n });\n });\n setChartData({\n labels,\n datasets: [\n {\n label: '',\n data: dataArray,\n backgroundColor: [\n '#480A77',\n '#8075FF',\n '#89E8F1',\n '#FA198B',\n '#4BC6B9',\n '#F0EFF4',\n '#D1CFE2',\n '#BAA898',\n ],\n },\n ],\n });\n }\n }, [data]);\n\n return (\n
    \n \n
    \n );\n};\n","// hooks/dependencies\nimport React, { useState, useEffect } from 'react';\n\nimport { Chart as ChartJS, ArcElement, Tooltip, Legend } from 'chart.js';\nimport { Pie } from 'react-chartjs-2';\n\nChartJS.register(ArcElement, Tooltip, Legend);\n\ninterface Props {\n data: any;\n}\n\nexport const DirectionalityGene: React.FC = ({ data }) => {\n const [count, setCount] = useState([0, 0, 0]);\n\n const [chartData, setChartData] = useState({\n labels: ['Activating', 'Inhibiting', 'N/A'],\n datasets: [\n {\n data: [0, 0, 0],\n backgroundColor: [\n '#480A77',\n '#8075FF',\n '#89E8F1',\n '#FA198B',\n '#4BC6B9',\n '#F0EFF4',\n '#D1CFE2',\n '#BAA898',\n ],\n },\n ],\n });\n\n const options = {\n height: 500,\n responsive: true,\n };\n\n const labels = ['Activating', 'Inhibiting', 'N/A'];\n\n useEffect(() => {\n let countCopy = [0, 0, 0];\n data?.forEach((gene: any) => {\n gene?.interactions?.forEach((int: any) => {\n if (!int.interactionTypes.length) {\n countCopy[2] = count[2]++;\n } else {\n int.interactionTypes.forEach((type: any) => {\n if (type.directionality === 'INHIBITORY') {\n countCopy[1] = count[1]++;\n } else {\n countCopy[0] = count[0]++;\n }\n });\n }\n setCount(countCopy);\n setChartData({\n labels: ['Activating', 'Inhibiting', 'N/A'],\n datasets: [\n {\n data: countCopy,\n backgroundColor: [\n '#480A77',\n '#8075FF',\n '#89E8F1',\n '#FA198B',\n '#4BC6B9',\n '#F0EFF4',\n '#D1CFE2',\n '#BAA898',\n ],\n },\n ],\n });\n });\n });\n }, [data]);\n\n return (\n
    \n \n
    \n );\n};\n","// hooks/dependencies\nimport React, { useState, useEffect } from 'react';\nimport { Chart as ChartJS, ArcElement, Tooltip, Legend } from 'chart.js';\nimport { Pie } from 'react-chartjs-2';\n\nChartJS.register(ArcElement, Tooltip, Legend);\n\ninterface ApprovalRatings {\n [key: string]: number;\n}\n\ninterface Props {\n data: any;\n}\n\nexport const RegulatoryApprovalGene: React.FC = ({ data }) => {\n const [chartData, setChartData] = useState({\n labels: ['Activating', 'Inhibiting', 'N/A'],\n datasets: [\n {\n label: 'Dataset 1',\n data: [0, 0, 0],\n backgroundColor: [\n '#480A77',\n '#8075FF',\n '#89E8F1',\n '#FA198B',\n '#4BC6B9',\n '#F0EFF4',\n '#D1CFE2',\n '#BAA898',\n ],\n },\n ],\n });\n\n useEffect(() => {\n let newObj: ApprovalRatings = {};\n\n data?.forEach((gene: any) => {\n gene.interactions?.forEach((int: any) => {\n const rating = int?.drug?.approved ? 'Approved' : 'Not Approved';\n if (newObj[rating]) {\n ++newObj[rating];\n } else {\n newObj[rating] = 1;\n }\n });\n });\n let dataArray = [];\n let labelArray = [];\n\n for (const key in newObj) {\n dataArray.push(newObj[key]);\n labelArray.push(key);\n }\n\n setChartData({\n datasets: [\n {\n data: dataArray,\n backgroundColor: [\n '#480A77',\n '#8075FF',\n '#89E8F1',\n '#FA198B',\n '#4BC6B9',\n '#F0EFF4',\n '#D1CFE2',\n '#BAA898',\n ],\n },\n ],\n labels: labelArray,\n });\n }, [data]);\n\n const options = {\n responsive: true,\n plugins: {\n legend: {\n display: true,\n labels: {\n boxWidth: 15,\n padding: 8,\n },\n },\n },\n };\n\n return (\n
    \n \n
    \n );\n};\n","import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';\nimport generateUtilityClass from '../generateUtilityClass';\nexport function getLinearProgressUtilityClass(slot) {\n return generateUtilityClass('MuiLinearProgress', slot);\n}\nconst linearProgressClasses = generateUtilityClasses('MuiLinearProgress', ['root', 'colorPrimary', 'colorSecondary', 'determinate', 'indeterminate', 'buffer', 'query', 'dashed', 'dashedColorPrimary', 'dashedColorSecondary', 'bar', 'barColorPrimary', 'barColorSecondary', 'bar1Indeterminate', 'bar1Determinate', 'bar1Buffer', 'bar2Indeterminate', 'bar2Buffer']);\nexport default linearProgressClasses;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\", \"color\", \"value\", \"valueBuffer\", \"variant\"];\nlet _ = t => t,\n _t,\n _t2,\n _t3,\n _t4,\n _t5,\n _t6;\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport { keyframes, css, darken, lighten } from '@mui/system';\nimport capitalize from '../utils/capitalize';\nimport useTheme from '../styles/useTheme';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport { getLinearProgressUtilityClass } from './linearProgressClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst TRANSITION_DURATION = 4; // seconds\nconst indeterminate1Keyframe = keyframes(_t || (_t = _`\n 0% {\n left: -35%;\n right: 100%;\n }\n\n 60% {\n left: 100%;\n right: -90%;\n }\n\n 100% {\n left: 100%;\n right: -90%;\n }\n`));\nconst indeterminate2Keyframe = keyframes(_t2 || (_t2 = _`\n 0% {\n left: -200%;\n right: 100%;\n }\n\n 60% {\n left: 107%;\n right: -8%;\n }\n\n 100% {\n left: 107%;\n right: -8%;\n }\n`));\nconst bufferKeyframe = keyframes(_t3 || (_t3 = _`\n 0% {\n opacity: 1;\n background-position: 0 -23px;\n }\n\n 60% {\n opacity: 0;\n background-position: 0 -23px;\n }\n\n 100% {\n opacity: 1;\n background-position: -200px -23px;\n }\n`));\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n variant,\n color\n } = ownerState;\n const slots = {\n root: ['root', `color${capitalize(color)}`, variant],\n dashed: ['dashed', `dashedColor${capitalize(color)}`],\n bar1: ['bar', `barColor${capitalize(color)}`, (variant === 'indeterminate' || variant === 'query') && 'bar1Indeterminate', variant === 'determinate' && 'bar1Determinate', variant === 'buffer' && 'bar1Buffer'],\n bar2: ['bar', variant !== 'buffer' && `barColor${capitalize(color)}`, variant === 'buffer' && `color${capitalize(color)}`, (variant === 'indeterminate' || variant === 'query') && 'bar2Indeterminate', variant === 'buffer' && 'bar2Buffer']\n };\n return composeClasses(slots, getLinearProgressUtilityClass, classes);\n};\nconst getColorShade = (theme, color) => {\n if (color === 'inherit') {\n return 'currentColor';\n }\n if (theme.vars) {\n return theme.vars.palette.LinearProgress[`${color}Bg`];\n }\n return theme.palette.mode === 'light' ? lighten(theme.palette[color].main, 0.62) : darken(theme.palette[color].main, 0.5);\n};\nconst LinearProgressRoot = styled('span', {\n name: 'MuiLinearProgress',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[`color${capitalize(ownerState.color)}`], styles[ownerState.variant]];\n }\n})(({\n ownerState,\n theme\n}) => _extends({\n position: 'relative',\n overflow: 'hidden',\n display: 'block',\n height: 4,\n zIndex: 0,\n // Fix Safari's bug during composition of different paint.\n '@media print': {\n colorAdjust: 'exact'\n },\n backgroundColor: getColorShade(theme, ownerState.color)\n}, ownerState.color === 'inherit' && ownerState.variant !== 'buffer' && {\n backgroundColor: 'none',\n '&::before': {\n content: '\"\"',\n position: 'absolute',\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'currentColor',\n opacity: 0.3\n }\n}, ownerState.variant === 'buffer' && {\n backgroundColor: 'transparent'\n}, ownerState.variant === 'query' && {\n transform: 'rotate(180deg)'\n}));\nconst LinearProgressDashed = styled('span', {\n name: 'MuiLinearProgress',\n slot: 'Dashed',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.dashed, styles[`dashedColor${capitalize(ownerState.color)}`]];\n }\n})(({\n ownerState,\n theme\n}) => {\n const backgroundColor = getColorShade(theme, ownerState.color);\n return _extends({\n position: 'absolute',\n marginTop: 0,\n height: '100%',\n width: '100%'\n }, ownerState.color === 'inherit' && {\n opacity: 0.3\n }, {\n backgroundImage: `radial-gradient(${backgroundColor} 0%, ${backgroundColor} 16%, transparent 42%)`,\n backgroundSize: '10px 10px',\n backgroundPosition: '0 -23px'\n });\n}, css(_t4 || (_t4 = _`\n animation: ${0} 3s infinite linear;\n `), bufferKeyframe));\nconst LinearProgressBar1 = styled('span', {\n name: 'MuiLinearProgress',\n slot: 'Bar1',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.bar, styles[`barColor${capitalize(ownerState.color)}`], (ownerState.variant === 'indeterminate' || ownerState.variant === 'query') && styles.bar1Indeterminate, ownerState.variant === 'determinate' && styles.bar1Determinate, ownerState.variant === 'buffer' && styles.bar1Buffer];\n }\n})(({\n ownerState,\n theme\n}) => _extends({\n width: '100%',\n position: 'absolute',\n left: 0,\n bottom: 0,\n top: 0,\n transition: 'transform 0.2s linear',\n transformOrigin: 'left',\n backgroundColor: ownerState.color === 'inherit' ? 'currentColor' : (theme.vars || theme).palette[ownerState.color].main\n}, ownerState.variant === 'determinate' && {\n transition: `transform .${TRANSITION_DURATION}s linear`\n}, ownerState.variant === 'buffer' && {\n zIndex: 1,\n transition: `transform .${TRANSITION_DURATION}s linear`\n}), ({\n ownerState\n}) => (ownerState.variant === 'indeterminate' || ownerState.variant === 'query') && css(_t5 || (_t5 = _`\n width: auto;\n animation: ${0} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n `), indeterminate1Keyframe));\nconst LinearProgressBar2 = styled('span', {\n name: 'MuiLinearProgress',\n slot: 'Bar2',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.bar, styles[`barColor${capitalize(ownerState.color)}`], (ownerState.variant === 'indeterminate' || ownerState.variant === 'query') && styles.bar2Indeterminate, ownerState.variant === 'buffer' && styles.bar2Buffer];\n }\n})(({\n ownerState,\n theme\n}) => _extends({\n width: '100%',\n position: 'absolute',\n left: 0,\n bottom: 0,\n top: 0,\n transition: 'transform 0.2s linear',\n transformOrigin: 'left'\n}, ownerState.variant !== 'buffer' && {\n backgroundColor: ownerState.color === 'inherit' ? 'currentColor' : (theme.vars || theme).palette[ownerState.color].main\n}, ownerState.color === 'inherit' && {\n opacity: 0.3\n}, ownerState.variant === 'buffer' && {\n backgroundColor: getColorShade(theme, ownerState.color),\n transition: `transform .${TRANSITION_DURATION}s linear`\n}), ({\n ownerState\n}) => (ownerState.variant === 'indeterminate' || ownerState.variant === 'query') && css(_t6 || (_t6 = _`\n width: auto;\n animation: ${0} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;\n `), indeterminate2Keyframe));\n\n/**\n * ## ARIA\n *\n * If the progress bar is describing the loading progress of a particular region of a page,\n * you should use `aria-describedby` to point to the progress bar, and set the `aria-busy`\n * attribute to `true` on that region until it has finished loading.\n */\nconst LinearProgress = /*#__PURE__*/React.forwardRef(function LinearProgress(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiLinearProgress'\n });\n const {\n className,\n color = 'primary',\n value,\n valueBuffer,\n variant = 'indeterminate'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n color,\n variant\n });\n const classes = useUtilityClasses(ownerState);\n const theme = useTheme();\n const rootProps = {};\n const inlineStyles = {\n bar1: {},\n bar2: {}\n };\n if (variant === 'determinate' || variant === 'buffer') {\n if (value !== undefined) {\n rootProps['aria-valuenow'] = Math.round(value);\n rootProps['aria-valuemin'] = 0;\n rootProps['aria-valuemax'] = 100;\n let transform = value - 100;\n if (theme.direction === 'rtl') {\n transform = -transform;\n }\n inlineStyles.bar1.transform = `translateX(${transform}%)`;\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('MUI: You need to provide a value prop ' + 'when using the determinate or buffer variant of LinearProgress .');\n }\n }\n if (variant === 'buffer') {\n if (valueBuffer !== undefined) {\n let transform = (valueBuffer || 0) - 100;\n if (theme.direction === 'rtl') {\n transform = -transform;\n }\n inlineStyles.bar2.transform = `translateX(${transform}%)`;\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('MUI: You need to provide a valueBuffer prop ' + 'when using the buffer variant of LinearProgress.');\n }\n }\n return /*#__PURE__*/_jsxs(LinearProgressRoot, _extends({\n className: clsx(classes.root, className),\n ownerState: ownerState,\n role: \"progressbar\"\n }, rootProps, {\n ref: ref\n }, other, {\n children: [variant === 'buffer' ? /*#__PURE__*/_jsx(LinearProgressDashed, {\n className: classes.dashed,\n ownerState: ownerState\n }) : null, /*#__PURE__*/_jsx(LinearProgressBar1, {\n className: classes.bar1,\n ownerState: ownerState,\n style: inlineStyles.bar1\n }), variant === 'determinate' ? null : /*#__PURE__*/_jsx(LinearProgressBar2, {\n className: classes.bar2,\n ownerState: ownerState,\n style: inlineStyles.bar2\n })]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? LinearProgress.propTypes /* remove-proptypes */ = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).\n * @default 'primary'\n */\n color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['inherit', 'primary', 'secondary']), PropTypes.string]),\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The value of the progress indicator for the determinate and buffer variants.\n * Value between 0 and 100.\n */\n value: PropTypes.number,\n /**\n * The value for the buffer variant.\n * Value between 0 and 100.\n */\n valueBuffer: PropTypes.number,\n /**\n * The variant to use.\n * Use indeterminate or query when there is no progress value.\n * @default 'indeterminate'\n */\n variant: PropTypes.oneOf(['buffer', 'determinate', 'indeterminate', 'query'])\n} : void 0;\nexport default LinearProgress;","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}","import _formatMuiErrorMessage from \"./formatMuiErrorMessage\";\n// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.\n//\n// A strict capitalization should uppercase the first letter of each word in the sentence.\n// We only handle the first word.\nexport default function capitalize(string) {\n if (typeof string !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: \\`capitalize(string)\\` expects a string argument.` : _formatMuiErrorMessage(7));\n }\n return string.charAt(0).toUpperCase() + string.slice(1);\n}","/**\n * WARNING: Don't import this directly.\n * Use `MuiError` from `@mui/utils/macros/MuiError.macro` instead.\n * @param {number} code\n */\nexport default function formatMuiErrorMessage(code) {\n // Apply babel-plugin-transform-template-literals in loose mode\n // loose mode is safe iff we're concatenating primitives\n // see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose\n /* eslint-disable prefer-template */\n let url = 'https://mui.com/production-error/?code=' + code;\n for (let i = 1; i < arguments.length; i += 1) {\n // rest params over-transpile for this case\n // eslint-disable-next-line prefer-rest-params\n url += '&args[]=' + encodeURIComponent(arguments[i]);\n }\n return 'Minified MUI error #' + code + '; visit ' + url + ' for the full message.';\n /* eslint-enable prefer-template */\n}","export default function composeClasses(slots, getUtilityClass, classes) {\n const output = {};\n Object.keys(slots).forEach(\n // `Objet.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.\n // @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208\n slot => {\n output[slot] = slots[slot].reduce((acc, key) => {\n if (key) {\n acc.push(getUtilityClass(key));\n if (classes && classes[key]) {\n acc.push(classes[key]);\n }\n }\n return acc;\n }, []).join(' ');\n });\n return output;\n}","/**\n * TODO v5: consider making it private\n *\n * passes {value} to {ref}\n *\n * WARNING: Be sure to only call this inside a callback that is passed as a ref.\n * Otherwise, make sure to cleanup the previous {ref} if it changes. See\n * https://github.com/mui/material-ui/issues/13539\n *\n * Useful if you want to expose the ref of an inner component to the public API\n * while still using it inside the component.\n * @param ref A ref callback or ref object. If anything falsy, this is a no-op.\n */\nexport default function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}","import * as React from 'react';\nimport setRef from './setRef';\nexport default function useForkRef(...refs) {\n /**\n * This will create a new function if the refs passed to this hook change and are all defined.\n * This means react will call the old forkRef with `null` and the new forkRef\n * with the ref. Cleanup naturally emerges from this behavior.\n */\n return React.useMemo(() => {\n if (refs.every(ref => ref == null)) {\n return null;\n }\n return instance => {\n refs.forEach(ref => {\n setRef(ref, instance);\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, refs);\n}","import * as React from 'react';\nconst useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nexport default useEnhancedEffect;","const defaultGenerator = componentName => componentName;\nconst createClassNameGenerator = () => {\n let generate = defaultGenerator;\n return {\n configure(generator) {\n generate = generator;\n },\n generate(componentName) {\n return generate(componentName);\n },\n reset() {\n generate = defaultGenerator;\n }\n };\n};\nconst ClassNameGenerator = createClassNameGenerator();\nexport default ClassNameGenerator;","import ClassNameGenerator from '../ClassNameGenerator';\nconst globalStateClassesMapping = {\n active: 'active',\n checked: 'checked',\n completed: 'completed',\n disabled: 'disabled',\n readOnly: 'readOnly',\n error: 'error',\n expanded: 'expanded',\n focused: 'focused',\n focusVisible: 'focusVisible',\n required: 'required',\n selected: 'selected'\n};\nexport default function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {\n const globalStateClass = globalStateClassesMapping[slot];\n return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;\n}","import generateUtilityClass from '../generateUtilityClass';\nexport default function generateUtilityClasses(componentName, slots, globalStatePrefix = 'Mui') {\n const result = {};\n slots.forEach(slot => {\n result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);\n });\n return result;\n}","import { unstable_generateUtilityClasses as generateUtilityClasses, unstable_generateUtilityClass as generateUtilityClass } from '@mui/utils';\nexport function getDataGridUtilityClass(slot) {\n return generateUtilityClass('MuiDataGrid', slot);\n}\nexport const gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell', 'cellContent', 'cellCheckbox', 'cellSkeleton', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnGroupHeader', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeader--showColumnBorder', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorderColor', 'cell--withRightBorder', 'columnHeader--withRightBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { alpha, styled, darken, lighten } from '@mui/material/styles';\nimport { gridClasses } from '../../constants/gridClasses';\nfunction getBorderColor(theme) {\n if (theme.vars) {\n return theme.vars.palette.TableCell.border;\n }\n if (theme.palette.mode === 'light') {\n return lighten(alpha(theme.palette.divider, 1), 0.88);\n }\n return darken(alpha(theme.palette.divider, 1), 0.68);\n}\nexport const GridRootStyles = styled('div', {\n name: 'MuiDataGrid',\n slot: 'Root',\n overridesResolver: (props, styles) => [{\n [`&.${gridClasses.autoHeight}`]: styles.autoHeight\n }, {\n [`&.${gridClasses.aggregationColumnHeader}`]: styles.aggregationColumnHeader\n }, {\n [`&.${gridClasses['aggregationColumnHeader--alignLeft']}`]: styles['aggregationColumnHeader--alignLeft']\n }, {\n [`&.${gridClasses['aggregationColumnHeader--alignCenter']}`]: styles['aggregationColumnHeader--alignCenter']\n }, {\n [`&.${gridClasses['aggregationColumnHeader--alignRight']}`]: styles['aggregationColumnHeader--alignRight']\n }, {\n [`&.${gridClasses.aggregationColumnHeaderLabel}`]: styles.aggregationColumnHeaderLabel\n }, {\n [`&.${gridClasses['root--disableUserSelection']} .${gridClasses.cell}`]: styles['root--disableUserSelection']\n }, {\n [`& .${gridClasses.editBooleanCell}`]: styles.editBooleanCell\n }, {\n [`& .${gridClasses['cell--editing']}`]: styles['cell--editing']\n }, {\n [`& .${gridClasses['cell--textCenter']}`]: styles['cell--textCenter']\n }, {\n [`& .${gridClasses['cell--textLeft']}`]: styles['cell--textLeft']\n }, {\n [`& .${gridClasses['cell--textRight']}`]: styles['cell--textRight']\n },\n // TODO v6: Remove\n {\n [`& .${gridClasses['cell--withRenderer']}`]: styles['cell--withRenderer']\n }, {\n [`& .${gridClasses.cell}`]: styles.cell\n }, {\n [`& .${gridClasses['cell--rangeTop']}`]: styles['cell--rangeTop']\n }, {\n [`& .${gridClasses['cell--rangeBottom']}`]: styles['cell--rangeBottom']\n }, {\n [`& .${gridClasses['cell--rangeLeft']}`]: styles['cell--rangeLeft']\n }, {\n [`& .${gridClasses['cell--rangeRight']}`]: styles['cell--rangeRight']\n }, {\n [`& .${gridClasses.cellContent}`]: styles.cellContent\n }, {\n [`& .${gridClasses.cellCheckbox}`]: styles.cellCheckbox\n }, {\n [`& .${gridClasses.cellSkeleton}`]: styles.cellSkeleton\n }, {\n [`& .${gridClasses.checkboxInput}`]: styles.checkboxInput\n }, {\n [`& .${gridClasses['columnHeader--alignCenter']}`]: styles['columnHeader--alignCenter']\n }, {\n [`& .${gridClasses['columnHeader--alignLeft']}`]: styles['columnHeader--alignLeft']\n }, {\n [`& .${gridClasses['columnHeader--alignRight']}`]: styles['columnHeader--alignRight']\n }, {\n [`& .${gridClasses['columnHeader--dragging']}`]: styles['columnHeader--dragging']\n }, {\n [`& .${gridClasses['columnHeader--moving']}`]: styles['columnHeader--moving']\n }, {\n [`& .${gridClasses['columnHeader--numeric']}`]: styles['columnHeader--numeric']\n }, {\n [`& .${gridClasses['columnHeader--sortable']}`]: styles['columnHeader--sortable']\n }, {\n [`& .${gridClasses['columnHeader--sorted']}`]: styles['columnHeader--sorted']\n }, {\n [`& .${gridClasses.columnHeader}`]: styles.columnHeader\n }, {\n [`& .${gridClasses.columnHeaderCheckbox}`]: styles.columnHeaderCheckbox\n }, {\n [`& .${gridClasses.columnHeaderDraggableContainer}`]: styles.columnHeaderDraggableContainer\n }, {\n [`& .${gridClasses.columnHeaderTitleContainer}`]: styles.columnHeaderTitleContainer\n }, {\n [`& .${gridClasses['columnSeparator--resizable']}`]: styles['columnSeparator--resizable']\n }, {\n [`& .${gridClasses['columnSeparator--resizing']}`]: styles['columnSeparator--resizing']\n }, {\n [`& .${gridClasses.columnSeparator}`]: styles.columnSeparator\n }, {\n [`& .${gridClasses.filterIcon}`]: styles.filterIcon\n }, {\n [`& .${gridClasses.iconSeparator}`]: styles.iconSeparator\n }, {\n [`& .${gridClasses.menuIcon}`]: styles.menuIcon\n }, {\n [`& .${gridClasses.menuIconButton}`]: styles.menuIconButton\n }, {\n [`& .${gridClasses.menuOpen}`]: styles.menuOpen\n }, {\n [`& .${gridClasses.menuList}`]: styles.menuList\n }, {\n [`& .${gridClasses['row--editable']}`]: styles['row--editable']\n }, {\n [`& .${gridClasses['row--editing']}`]: styles['row--editing']\n }, {\n [`& .${gridClasses['row--dragging']}`]: styles['row--dragging']\n }, {\n [`& .${gridClasses.row}`]: styles.row\n }, {\n [`& .${gridClasses.rowReorderCellPlaceholder}`]: styles.rowReorderCellPlaceholder\n }, {\n [`& .${gridClasses.rowReorderCell}`]: styles.rowReorderCell\n }, {\n [`& .${gridClasses['rowReorderCell--draggable']}`]: styles['rowReorderCell--draggable']\n }, {\n [`& .${gridClasses.sortIcon}`]: styles.sortIcon\n }, {\n [`& .${gridClasses.withBorderColor}`]: styles.withBorderColor\n }, {\n [`& .${gridClasses.treeDataGroupingCell}`]: styles.treeDataGroupingCell\n }, {\n [`& .${gridClasses.treeDataGroupingCellToggle}`]: styles.treeDataGroupingCellToggle\n }, {\n [`& .${gridClasses.detailPanelToggleCell}`]: styles.detailPanelToggleCell\n }, {\n [`& .${gridClasses['detailPanelToggleCell--expanded']}`]: styles['detailPanelToggleCell--expanded']\n }, styles.root]\n})(({\n theme\n}) => {\n const borderColor = getBorderColor(theme);\n const radius = theme.shape.borderRadius;\n const gridStyle = _extends({\n '--unstable_DataGrid-radius': typeof radius === 'number' ? `${radius}px` : radius,\n '--unstable_DataGrid-headWeight': theme.typography.fontWeightMedium,\n '--unstable_DataGrid-overlayBackground': theme.vars ? `rgba(${theme.vars.palette.background.defaultChannel} / ${theme.vars.palette.action.disabledOpacity})` : alpha(theme.palette.background.default, theme.palette.action.disabledOpacity),\n flex: 1,\n boxSizing: 'border-box',\n position: 'relative',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor,\n borderRadius: 'var(--unstable_DataGrid-radius)',\n color: (theme.vars || theme).palette.text.primary\n }, theme.typography.body2, {\n outline: 'none',\n height: '100%',\n display: 'flex',\n flexDirection: 'column',\n overflowAnchor: 'none',\n // Keep the same scrolling position\n [`&.${gridClasses.autoHeight}`]: {\n height: 'auto',\n [`& .${gridClasses['row--lastVisible']} .${gridClasses.cell}`]: {\n borderBottomColor: 'transparent'\n }\n },\n [`& .${gridClasses['virtualScrollerContent--overflowed']} .${gridClasses['row--lastVisible']} .${gridClasses.cell}`]: {\n borderBottomColor: 'transparent'\n },\n [`& .${gridClasses.columnHeader}, & .${gridClasses.cell}`]: {\n WebkitTapHighlightColor: 'transparent',\n lineHeight: null,\n padding: '0 10px',\n boxSizing: 'border-box'\n },\n [`& .${gridClasses.columnHeader}:focus-within, & .${gridClasses.cell}:focus-within`]: {\n outline: `solid ${theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / 0.5)` : alpha(theme.palette.primary.main, 0.5)} 1px`,\n outlineWidth: 1,\n outlineOffset: -1\n },\n [`& .${gridClasses.columnHeader}:focus, & .${gridClasses.cell}:focus`]: {\n outline: `solid ${theme.palette.primary.main} 1px`\n },\n [`& .${gridClasses.columnHeaderCheckbox}, & .${gridClasses.cellCheckbox}`]: {\n padding: 0,\n justifyContent: 'center',\n alignItems: 'center'\n },\n [`& .${gridClasses.columnHeader}`]: {\n position: 'relative',\n display: 'flex',\n alignItems: 'center'\n },\n [`& .${gridClasses['columnHeader--sorted']} .${gridClasses.iconButtonContainer}, & .${gridClasses['columnHeader--filtered']} .${gridClasses.iconButtonContainer}`]: {\n visibility: 'visible',\n width: 'auto'\n },\n [`& .${gridClasses.columnHeader}:not(.${gridClasses['columnHeader--sorted']}) .${gridClasses.sortIcon}`]: {\n opacity: 0,\n transition: theme.transitions.create(['opacity'], {\n duration: theme.transitions.duration.shorter\n })\n },\n [`& .${gridClasses.columnHeader}:not(.${gridClasses['columnHeader--sorted']}):hover .${gridClasses.sortIcon}`]: {\n opacity: 0.5\n },\n [`& .${gridClasses.columnHeaderTitleContainer}`]: {\n display: 'flex',\n alignItems: 'center',\n minWidth: 0,\n flex: 1,\n whiteSpace: 'nowrap',\n overflow: 'hidden'\n },\n [`& .${gridClasses.columnHeaderTitleContainerContent}`]: {\n overflow: 'hidden',\n display: 'flex',\n alignItems: 'center'\n },\n [`& .${gridClasses['columnHeader--filledGroup']} .${gridClasses.columnHeaderTitleContainer}`]: {\n borderBottomWidth: '1px',\n borderBottomStyle: 'solid',\n boxSizing: 'border-box'\n },\n [`& .${gridClasses['columnHeader--filledGroup']}.${gridClasses['columnHeader--showColumnBorder']} .${gridClasses.columnHeaderTitleContainer}`]: {\n borderBottom: `none`\n },\n [`& .${gridClasses['columnHeader--filledGroup']}.${gridClasses['columnHeader--showColumnBorder']}`]: {\n borderBottomWidth: '1px',\n borderBottomStyle: 'solid',\n boxSizing: 'border-box'\n },\n [`& .${gridClasses.sortIcon}, & .${gridClasses.filterIcon}`]: {\n fontSize: 'inherit'\n },\n [`& .${gridClasses['columnHeader--sortable']}`]: {\n cursor: 'pointer'\n },\n [`& .${gridClasses['columnHeader--alignCenter']} .${gridClasses.columnHeaderTitleContainer}`]: {\n justifyContent: 'center'\n },\n [`& .${gridClasses['columnHeader--alignRight']} .${gridClasses.columnHeaderDraggableContainer}, & .${gridClasses['columnHeader--alignRight']} .${gridClasses.columnHeaderTitleContainer}`]: {\n flexDirection: 'row-reverse'\n },\n [`& .${gridClasses['columnHeader--alignCenter']} .${gridClasses.menuIcon}, & .${gridClasses['columnHeader--alignRight']} .${gridClasses.menuIcon}`]: {\n marginRight: 'auto',\n marginLeft: -6\n },\n [`& .${gridClasses['columnHeader--alignRight']} .${gridClasses.menuIcon}, & .${gridClasses['columnHeader--alignRight']} .${gridClasses.menuIcon}`]: {\n marginRight: 'auto',\n marginLeft: -10\n },\n [`& .${gridClasses['columnHeader--moving']}`]: {\n backgroundColor: (theme.vars || theme).palette.action.hover\n },\n [`& .${gridClasses.columnSeparator}`]: {\n visibility: 'hidden',\n position: 'absolute',\n zIndex: 100,\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n color: borderColor\n },\n [`& .${gridClasses.columnHeaders}:hover .${gridClasses.columnSeparator}, .${gridClasses['columnSeparator--resizing']}`]: {\n visibility: 'visible',\n width: 'auto'\n },\n [`& .${gridClasses['columnSeparator--sideLeft']}`]: {\n left: -12\n },\n [`& .${gridClasses['columnSeparator--sideRight']}`]: {\n right: -12\n },\n [`& .${gridClasses['columnSeparator--resizable']}`]: {\n cursor: 'col-resize',\n touchAction: 'none',\n '&:hover': {\n color: (theme.vars || theme).palette.text.primary,\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n color: borderColor\n }\n },\n [`&.${gridClasses['columnSeparator--resizing']}`]: {\n color: (theme.vars || theme).palette.text.primary\n },\n '& svg': {\n pointerEvents: 'none'\n }\n },\n [`& .${gridClasses.iconSeparator}`]: {\n color: 'inherit'\n },\n [`& .${gridClasses.menuIcon}`]: {\n width: 0,\n visibility: 'hidden',\n fontSize: 20,\n marginRight: -10,\n display: 'flex',\n alignItems: 'center'\n },\n [`& .${gridClasses.columnHeader}:hover`]: {\n [`& .${gridClasses.iconButtonContainer}`]: {\n visibility: 'visible',\n width: 'auto'\n },\n [`& .${gridClasses.menuIcon}`]: {\n width: 'auto',\n visibility: 'visible'\n }\n },\n [`.${gridClasses.menuOpen}`]: {\n visibility: 'visible',\n width: 'auto'\n },\n [`& .${gridClasses.row}`]: {\n display: 'flex',\n width: 'fit-content',\n breakInside: 'avoid',\n // Avoid the row to be broken in two different print pages.\n '&:hover, &.Mui-hovered': {\n backgroundColor: (theme.vars || theme).palette.action.hover,\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n },\n '&.Mui-selected': {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity),\n '&:hover, &.Mui-hovered': {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity + theme.palette.action.hoverOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity)\n }\n }\n }\n },\n [`& .${gridClasses.cell}`]: {\n display: 'flex',\n alignItems: 'center',\n borderBottom: '1px solid',\n '&.Mui-selected': {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity),\n '&:hover, &.Mui-hovered': {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity + theme.palette.action.hoverOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity)\n }\n }\n }\n },\n [`&.${gridClasses['root--disableUserSelection']} .${gridClasses.cell}`]: {\n userSelect: 'none'\n },\n [`& .${gridClasses.row}:not(.${gridClasses['row--dynamicHeight']}) > .${gridClasses.cell}`]: {\n overflow: 'hidden',\n whiteSpace: 'nowrap'\n },\n [`& .${gridClasses.cellContent}`]: {\n overflow: 'hidden',\n textOverflow: 'ellipsis'\n },\n [`& .${gridClasses.cell}.${gridClasses['cell--editing']}`]: {\n padding: 1,\n display: 'flex',\n boxShadow: theme.shadows[2],\n backgroundColor: (theme.vars || theme).palette.background.paper,\n '&:focus-within': {\n outline: `solid ${(theme.vars || theme).palette.primary.main} 1px`,\n outlineOffset: '-1px'\n }\n },\n [`& .${gridClasses['row--editing']}`]: {\n boxShadow: theme.shadows[2]\n },\n [`& .${gridClasses['row--editing']} .${gridClasses.cell}`]: {\n boxShadow: theme.shadows[0],\n backgroundColor: (theme.vars || theme).palette.background.paper\n },\n [`& .${gridClasses.editBooleanCell}`]: {\n display: 'flex',\n height: '100%',\n width: '100%',\n alignItems: 'center',\n justifyContent: 'center'\n },\n [`& .${gridClasses.booleanCell}[data-value=\"true\"]`]: {\n color: (theme.vars || theme).palette.text.secondary\n },\n [`& .${gridClasses.booleanCell}[data-value=\"false\"]`]: {\n color: (theme.vars || theme).palette.text.disabled\n },\n [`& .${gridClasses.actionsCell}`]: {\n display: 'inline-flex',\n alignItems: 'center',\n gridGap: theme.spacing(1)\n },\n [`& .${gridClasses.rowReorderCell}`]: {\n display: 'inline-flex',\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n opacity: (theme.vars || theme).palette.action.disabledOpacity\n },\n [`& .${gridClasses['rowReorderCell--draggable']}`]: {\n cursor: 'move',\n opacity: 1\n },\n [`& .${gridClasses.rowReorderCellContainer}`]: {\n padding: 0,\n alignItems: 'stretch'\n },\n [`.${gridClasses.withBorderColor}`]: {\n borderColor\n },\n [`& .${gridClasses['cell--withRightBorder']}`]: {\n borderRightWidth: '1px',\n borderRightStyle: 'solid'\n },\n [`& .${gridClasses['columnHeader--withRightBorder']}`]: {\n borderRightWidth: '1px',\n borderRightStyle: 'solid'\n },\n [`& .${gridClasses['cell--textLeft']}`]: {\n justifyContent: 'flex-start'\n },\n [`& .${gridClasses['cell--textRight']}`]: {\n justifyContent: 'flex-end'\n },\n [`& .${gridClasses['cell--textCenter']}`]: {\n justifyContent: 'center'\n },\n [`& .${gridClasses.columnHeaderDraggableContainer}`]: {\n display: 'flex',\n width: '100%',\n height: '100%'\n },\n [`& .${gridClasses.rowReorderCellPlaceholder}`]: {\n display: 'none'\n },\n [`& .${gridClasses['columnHeader--dragging']}, & .${gridClasses['row--dragging']}`]: {\n background: (theme.vars || theme).palette.background.paper,\n padding: '0 12px',\n borderRadius: 'var(--unstable_DataGrid-radius)',\n opacity: (theme.vars || theme).palette.action.disabledOpacity\n },\n [`& .${gridClasses['row--dragging']}`]: {\n background: (theme.vars || theme).palette.background.paper,\n padding: '0 12px',\n borderRadius: 'var(--unstable_DataGrid-radius)',\n opacity: (theme.vars || theme).palette.action.disabledOpacity,\n [`& .${gridClasses.rowReorderCellPlaceholder}`]: {\n display: 'flex'\n }\n },\n [`& .${gridClasses.treeDataGroupingCell}`]: {\n display: 'flex',\n alignItems: 'center',\n width: '100%'\n },\n [`& .${gridClasses.treeDataGroupingCellToggle}`]: {\n flex: '0 0 28px',\n alignSelf: 'stretch',\n marginRight: theme.spacing(2)\n },\n [`& .${gridClasses.groupingCriteriaCell}`]: {\n display: 'flex',\n alignItems: 'center',\n width: '100%'\n },\n [`& .${gridClasses.groupingCriteriaCellToggle}`]: {\n flex: '0 0 28px',\n alignSelf: 'stretch',\n marginRight: theme.spacing(2)\n }\n });\n return gridStyle;\n});","// Cache implementation based on Erik Rasmussen's `lru-memoize`:\n// https://github.com/erikras/lru-memoize\nvar NOT_FOUND = 'NOT_FOUND';\n\nfunction createSingletonCache(equals) {\n var entry;\n return {\n get: function get(key) {\n if (entry && equals(entry.key, key)) {\n return entry.value;\n }\n\n return NOT_FOUND;\n },\n put: function put(key, value) {\n entry = {\n key: key,\n value: value\n };\n },\n getEntries: function getEntries() {\n return entry ? [entry] : [];\n },\n clear: function clear() {\n entry = undefined;\n }\n };\n}\n\nfunction createLruCache(maxSize, equals) {\n var entries = [];\n\n function get(key) {\n var cacheIndex = entries.findIndex(function (entry) {\n return equals(key, entry.key);\n }); // We found a cached entry\n\n if (cacheIndex > -1) {\n var entry = entries[cacheIndex]; // Cached entry not at top of cache, move it to the top\n\n if (cacheIndex > 0) {\n entries.splice(cacheIndex, 1);\n entries.unshift(entry);\n }\n\n return entry.value;\n } // No entry found in cache, return sentinel\n\n\n return NOT_FOUND;\n }\n\n function put(key, value) {\n if (get(key) === NOT_FOUND) {\n // TODO Is unshift slow?\n entries.unshift({\n key: key,\n value: value\n });\n\n if (entries.length > maxSize) {\n entries.pop();\n }\n }\n }\n\n function getEntries() {\n return entries;\n }\n\n function clear() {\n entries = [];\n }\n\n return {\n get: get,\n put: put,\n getEntries: getEntries,\n clear: clear\n };\n}\n\nexport var defaultEqualityCheck = function defaultEqualityCheck(a, b) {\n return a === b;\n};\nexport function createCacheKeyComparator(equalityCheck) {\n return function areArgumentsShallowlyEqual(prev, next) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n\n\n var length = prev.length;\n\n for (var i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n };\n}\n// defaultMemoize now supports a configurable cache size with LRU behavior,\n// and optional comparison of the result value with existing values\nexport function defaultMemoize(func, equalityCheckOrOptions) {\n var providedOptions = typeof equalityCheckOrOptions === 'object' ? equalityCheckOrOptions : {\n equalityCheck: equalityCheckOrOptions\n };\n var _providedOptions$equa = providedOptions.equalityCheck,\n equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa,\n _providedOptions$maxS = providedOptions.maxSize,\n maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS,\n resultEqualityCheck = providedOptions.resultEqualityCheck;\n var comparator = createCacheKeyComparator(equalityCheck);\n var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); // we reference arguments instead of spreading them for performance reasons\n\n function memoized() {\n var value = cache.get(arguments);\n\n if (value === NOT_FOUND) {\n // @ts-ignore\n value = func.apply(null, arguments);\n\n if (resultEqualityCheck) {\n var entries = cache.getEntries();\n var matchingEntry = entries.find(function (entry) {\n return resultEqualityCheck(entry.value, value);\n });\n\n if (matchingEntry) {\n value = matchingEntry.value;\n }\n }\n\n cache.put(arguments, value);\n }\n\n return value;\n }\n\n memoized.clearCache = function () {\n return cache.clear();\n };\n\n return memoized;\n}","import { defaultMemoize, defaultEqualityCheck } from './defaultMemoize';\nexport { defaultMemoize, defaultEqualityCheck };\n\nfunction getDependencies(funcs) {\n var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;\n\n if (!dependencies.every(function (dep) {\n return typeof dep === 'function';\n })) {\n var dependencyTypes = dependencies.map(function (dep) {\n return typeof dep === 'function' ? \"function \" + (dep.name || 'unnamed') + \"()\" : typeof dep;\n }).join(', ');\n throw new Error(\"createSelector expects all input-selectors to be functions, but received the following types: [\" + dependencyTypes + \"]\");\n }\n\n return dependencies;\n}\n\nexport function createSelectorCreator(memoize) {\n for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n memoizeOptionsFromArgs[_key - 1] = arguments[_key];\n }\n\n var createSelector = function createSelector() {\n for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n funcs[_key2] = arguments[_key2];\n }\n\n var _recomputations = 0;\n\n var _lastResult; // Due to the intricacies of rest params, we can't do an optional arg after `...funcs`.\n // So, start by declaring the default value here.\n // (And yes, the words 'memoize' and 'options' appear too many times in this next sequence.)\n\n\n var directlyPassedOptions = {\n memoizeOptions: undefined\n }; // Normally, the result func or \"output selector\" is the last arg\n\n var resultFunc = funcs.pop(); // If the result func is actually an _object_, assume it's our options object\n\n if (typeof resultFunc === 'object') {\n directlyPassedOptions = resultFunc; // and pop the real result func off\n\n resultFunc = funcs.pop();\n }\n\n if (typeof resultFunc !== 'function') {\n throw new Error(\"createSelector expects an output function after the inputs, but received: [\" + typeof resultFunc + \"]\");\n } // Determine which set of options we're using. Prefer options passed directly,\n // but fall back to options given to createSelectorCreator.\n\n\n var _directlyPassedOption = directlyPassedOptions,\n _directlyPassedOption2 = _directlyPassedOption.memoizeOptions,\n memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2; // Simplifying assumption: it's unlikely that the first options arg of the provided memoizer\n // is an array. In most libs I've looked at, it's an equality function or options object.\n // Based on that, if `memoizeOptions` _is_ an array, we assume it's a full\n // user-provided array of options. Otherwise, it must be just the _first_ arg, and so\n // we wrap it in an array so we can apply it.\n\n var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions];\n var dependencies = getDependencies(funcs);\n var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() {\n _recomputations++; // apply arguments instead of spreading for performance.\n\n return resultFunc.apply(null, arguments);\n }].concat(finalMemoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again.\n\n var selector = memoize(function dependenciesChecker() {\n var params = [];\n var length = dependencies.length;\n\n for (var i = 0; i < length; i++) {\n // apply arguments instead of spreading and mutate a local list of params for performance.\n // @ts-ignore\n params.push(dependencies[i].apply(null, arguments));\n } // apply arguments instead of spreading for performance.\n\n\n _lastResult = memoizedResultFunc.apply(null, params);\n return _lastResult;\n });\n Object.assign(selector, {\n resultFunc: resultFunc,\n memoizedResultFunc: memoizedResultFunc,\n dependencies: dependencies,\n lastResult: function lastResult() {\n return _lastResult;\n },\n recomputations: function recomputations() {\n return _recomputations;\n },\n resetRecomputations: function resetRecomputations() {\n return _recomputations = 0;\n }\n });\n return selector;\n }; // @ts-ignore\n\n\n return createSelector;\n}\nexport var createSelector = /* #__PURE__ */createSelectorCreator(defaultMemoize);\n// Manual definition of state and output arguments\nexport var createStructuredSelector = function createStructuredSelector(selectors, selectorCreator) {\n if (selectorCreator === void 0) {\n selectorCreator = createSelector;\n }\n\n if (typeof selectors !== 'object') {\n throw new Error('createStructuredSelector expects first argument to be an object ' + (\"where each property is a selector, instead received a \" + typeof selectors));\n }\n\n var objectKeys = Object.keys(selectors);\n var resultSelector = selectorCreator( // @ts-ignore\n objectKeys.map(function (key) {\n return selectors[key];\n }), function () {\n for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n values[_key3] = arguments[_key3];\n }\n\n return values.reduce(function (composition, value, index) {\n composition[objectKeys[index]] = value;\n return composition;\n }, {});\n });\n return resultSelector;\n};","export const buildWarning = (message, gravity = 'warning') => {\n let alreadyWarned = false;\n const cleanMessage = Array.isArray(message) ? message.join('\\n') : message;\n return () => {\n if (!alreadyWarned) {\n alreadyWarned = true;\n if (gravity === 'error') {\n console.error(cleanMessage);\n } else {\n console.warn(cleanMessage);\n }\n }\n };\n};\nexport const wrapWithWarningOnCall = (method, message) => {\n if (process.env.NODE_ENV === 'production') {\n return method;\n }\n const warning = buildWarning(message);\n return (...args) => {\n warning();\n return method(...args);\n };\n};","import { createSelector as reselectCreateSelector } from 'reselect';\nimport { buildWarning } from './warning';\nconst cacheContainer = {\n cache: null\n};\nconst missingInstanceIdWarning = buildWarning(['MUI: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, e.g. `mySelector(apiRef)`, or pass the instance ID explicitly, e.g `mySelector(state, apiRef.current.instanceId)`.']);\nexport const createSelector = (...args) => {\n if (cacheContainer.cache === null) {\n cacheContainer.cache = {};\n }\n const selector = (...selectorArgs) => {\n const [stateOrApiRef, instanceId] = selectorArgs;\n const isApiRef = !!stateOrApiRef.current;\n const cacheKey = isApiRef ? stateOrApiRef.current.instanceId : instanceId != null ? instanceId : 'default';\n const state = isApiRef ? stateOrApiRef.current.state : stateOrApiRef;\n if (process.env.NODE_ENV !== 'production') {\n if (cacheKey === 'default') {\n missingInstanceIdWarning();\n }\n }\n if (cacheContainer.cache === null) {\n cacheContainer.cache = {};\n }\n const {\n cache\n } = cacheContainer;\n if (cache[cacheKey] && cache[cacheKey].get(args)) {\n // We pass the cache key because the called selector might have as\n // dependency another selector created with this `createSelector`.\n return cache[cacheKey].get(args)(state, cacheKey);\n }\n const newSelector = reselectCreateSelector(...args);\n if (!cache[cacheKey]) {\n cache[cacheKey] = new Map();\n }\n cache[cacheKey].set(args, newSelector);\n return newSelector(state, cacheKey);\n };\n\n // We use this property to detect if the selector was created with createSelector\n // or it's only a simple function the receives the state and returns part of it.\n selector.acceptsApiRef = true;\n return selector;\n};\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const unstable_resetCreateSelectorCache = cacheKey => {\n if (typeof cacheKey !== 'undefined') {\n if (cacheContainer.cache && cacheContainer.cache[cacheKey]) {\n delete cacheContainer.cache[cacheKey];\n }\n } else {\n cacheContainer.cache = null;\n }\n};","import { createSelector } from '../../../utils/createSelector';\n/**\n * Get the columns state\n * @category Columns\n */\nexport const gridColumnsStateSelector = state => state.columns;\n\n/**\n * Get an array of column fields in the order rendered on screen.\n * @category Columns\n */\nexport const gridColumnFieldsSelector = createSelector(gridColumnsStateSelector, columnsState => columnsState.orderedFields);\n\n/**\n * Get the columns as a lookup (an object containing the field for keys and the definition for values).\n * @category Columns\n */\nexport const gridColumnLookupSelector = createSelector(gridColumnsStateSelector, columnsState => columnsState.lookup);\n\n/**\n * Get an array of column definitions in the order rendered on screen..\n * @category Columns\n */\nexport const gridColumnDefinitionsSelector = createSelector(gridColumnFieldsSelector, gridColumnLookupSelector, (allFields, lookup) => allFields.map(field => lookup[field]));\n\n/**\n * Get the column visibility model, containing the visibility status of each column.\n * If a column is not registered in the model, it is visible.\n * @category Visible Columns\n */\nexport const gridColumnVisibilityModelSelector = createSelector(gridColumnsStateSelector, columnsState => columnsState.columnVisibilityModel);\n\n/**\n * Get the visible columns as a lookup (an object containing the field for keys and the definition for values).\n * @category Visible Columns\n */\nexport const gridVisibleColumnDefinitionsSelector = createSelector(gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector, (columns, columnVisibilityModel) => columns.filter(column => columnVisibilityModel[column.field] !== false));\n\n/**\n * Get the field of each visible column.\n * @category Visible Columns\n */\nexport const gridVisibleColumnFieldsSelector = createSelector(gridVisibleColumnDefinitionsSelector, visibleColumns => visibleColumns.map(column => column.field));\n\n/**\n * Get the left position in pixel of each visible columns relative to the left of the first column.\n * @category Visible Columns\n */\nexport const gridColumnPositionsSelector = createSelector(gridVisibleColumnDefinitionsSelector, visibleColumns => {\n const positions = [];\n let currentPosition = 0;\n for (let i = 0; i < visibleColumns.length; i += 1) {\n positions.push(currentPosition);\n currentPosition += visibleColumns[i].computedWidth;\n }\n return positions;\n});\n\n/**\n * Get the summed width of all the visible columns.\n * @category Visible Columns\n */\nexport const gridColumnsTotalWidthSelector = createSelector(gridVisibleColumnDefinitionsSelector, gridColumnPositionsSelector, (visibleColumns, positions) => {\n const colCount = visibleColumns.length;\n if (colCount === 0) {\n return 0;\n }\n return positions[colCount - 1] + visibleColumns[colCount - 1].computedWidth;\n});\n\n/**\n * Get the filterable columns as an array.\n * @category Columns\n */\nexport const gridFilterableColumnDefinitionsSelector = createSelector(gridColumnDefinitionsSelector, columns => columns.filter(col => col.filterable));\n\n/**\n * Get the filterable columns as a lookup (an object containing the field for keys and the definition for values).\n * @category Columns\n */\nexport const gridFilterableColumnLookupSelector = createSelector(gridColumnDefinitionsSelector, columns => columns.reduce((acc, col) => {\n if (col.filterable) {\n acc[col.field] = col;\n }\n return acc;\n}, {}));","import { buildWarning } from '../../utils/warning';\nfunction isOutputSelector(selector) {\n return selector.acceptsApiRef;\n}\nconst stateNotInitializedWarning = buildWarning(['MUI: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.']);\nexport const useGridSelector = (apiRef, selector) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!apiRef.current.state) {\n stateNotInitializedWarning();\n }\n }\n if (isOutputSelector(selector)) {\n return selector(apiRef);\n }\n return selector(apiRef.current.state);\n};","import * as React from 'react';\nexport const GridPrivateApiContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== 'production') {\n GridPrivateApiContext.displayName = 'GridPrivateApiContext';\n}\nexport function useGridPrivateApiContext() {\n const privateApiRef = React.useContext(GridPrivateApiContext);\n if (privateApiRef === undefined) {\n throw new Error(['MUI: Could not find the data grid private context.', 'It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.', 'This can also happen if you are bundling multiple versions of the data grid.'].join('\\n'));\n }\n return privateApiRef;\n}","import * as React from 'react';\nconst GridRootPropsContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== 'production') {\n GridRootPropsContext.displayName = 'GridRootPropsContext';\n}\nexport { GridRootPropsContext };","import * as React from 'react';\nimport { GridRootPropsContext } from '../../context/GridRootPropsContext';\nexport const useGridRootProps = () => {\n const contextValue = React.useContext(GridRootPropsContext);\n if (!contextValue) {\n throw new Error('MUI: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.');\n }\n return contextValue;\n};","import { createSelector } from '../../../utils/createSelector';\nexport const gridDensitySelector = state => state.density;\nexport const gridDensityValueSelector = createSelector(gridDensitySelector, density => density.value);\nexport const gridDensityFactorSelector = createSelector(gridDensitySelector, density => density.factor);","import { createSelector } from '../../../utils/createSelector';\n/**\n * @category ColumnGrouping\n * @ignore - do not document.\n */\nexport const gridColumnGroupingSelector = state => state.columnGrouping;\nexport const gridColumnGroupsUnwrappedModelSelector = createSelector(gridColumnGroupingSelector, columnGrouping => {\n var _columnGrouping$unwra;\n return (_columnGrouping$unwra = columnGrouping == null ? void 0 : columnGrouping.unwrappedGroupingModel) != null ? _columnGrouping$unwra : {};\n});\nexport const gridColumnGroupsLookupSelector = createSelector(gridColumnGroupingSelector, columnGrouping => {\n var _columnGrouping$looku;\n return (_columnGrouping$looku = columnGrouping == null ? void 0 : columnGrouping.lookup) != null ? _columnGrouping$looku : {};\n});\nexport const gridColumnGroupsHeaderStructureSelector = createSelector(gridColumnGroupingSelector, columnGrouping => {\n var _columnGrouping$heade;\n return (_columnGrouping$heade = columnGrouping == null ? void 0 : columnGrouping.headerStructure) != null ? _columnGrouping$heade : [];\n});\nexport const gridColumnGroupsHeaderMaxDepthSelector = createSelector(gridColumnGroupingSelector, columnGrouping => {\n var _columnGrouping$maxDe;\n return (_columnGrouping$maxDe = columnGrouping == null ? void 0 : columnGrouping.maxDepth) != null ? _columnGrouping$maxDe : 0;\n});","import { createSelector } from '../../../utils/createSelector';\nconst gridRowsStateSelector = state => state.rows;\nexport const gridRowCountSelector = createSelector(gridRowsStateSelector, rows => rows.totalRowCount);\nexport const gridRowsLoadingSelector = createSelector(gridRowsStateSelector, rows => rows.loading);\nexport const gridTopLevelRowCountSelector = createSelector(gridRowsStateSelector, rows => rows.totalTopLevelRowCount);\n\n// TODO rows v6: Rename\nexport const gridRowsLookupSelector = createSelector(gridRowsStateSelector, rows => rows.dataRowIdToModelLookup);\nexport const gridRowsDataRowIdToIdLookupSelector = createSelector(gridRowsStateSelector, rows => rows.dataRowIdToIdLookup);\nexport const gridRowTreeSelector = createSelector(gridRowsStateSelector, rows => rows.tree);\nexport const gridRowGroupingNameSelector = createSelector(gridRowsStateSelector, rows => rows.groupingName);\nexport const gridRowTreeDepthsSelector = createSelector(gridRowsStateSelector, rows => rows.treeDepths);\nexport const gridRowMaximumTreeDepthSelector = createSelector(gridRowsStateSelector, rows => {\n const entries = Object.entries(rows.treeDepths);\n if (entries.length === 0) {\n return 1;\n }\n return entries.filter(([, nodeCount]) => nodeCount > 0).map(([depth]) => Number(depth)).sort((a, b) => b - a)[0] + 1;\n});\nexport const gridDataRowIdsSelector = createSelector(gridRowsStateSelector, rows => rows.dataRowIds);\n\n/**\n * @ignore - do not document.\n */\nexport const gridAdditionalRowGroupsSelector = createSelector(gridRowsStateSelector, rows => rows == null ? void 0 : rows.additionalRowGroups);\n\n/**\n * @ignore - do not document.\n */\nexport const gridPinnedRowsSelector = createSelector(gridAdditionalRowGroupsSelector, additionalRowGroups => {\n var _rawPinnedRows$bottom, _rawPinnedRows$top;\n const rawPinnedRows = additionalRowGroups == null ? void 0 : additionalRowGroups.pinnedRows;\n return {\n bottom: rawPinnedRows == null ? void 0 : (_rawPinnedRows$bottom = rawPinnedRows.bottom) == null ? void 0 : _rawPinnedRows$bottom.map(rowEntry => {\n var _rowEntry$model;\n return {\n id: rowEntry.id,\n model: (_rowEntry$model = rowEntry.model) != null ? _rowEntry$model : {}\n };\n }),\n top: rawPinnedRows == null ? void 0 : (_rawPinnedRows$top = rawPinnedRows.top) == null ? void 0 : _rawPinnedRows$top.map(rowEntry => {\n var _rowEntry$model2;\n return {\n id: rowEntry.id,\n model: (_rowEntry$model2 = rowEntry.model) != null ? _rowEntry$model2 : {}\n };\n })\n };\n});\n\n/**\n * @ignore - do not document.\n */\nexport const gridPinnedRowsCountSelector = createSelector(gridPinnedRowsSelector, pinnedRows => {\n var _pinnedRows$top, _pinnedRows$bottom;\n return ((pinnedRows == null ? void 0 : (_pinnedRows$top = pinnedRows.top) == null ? void 0 : _pinnedRows$top.length) || 0) + ((pinnedRows == null ? void 0 : (_pinnedRows$bottom = pinnedRows.bottom) == null ? void 0 : _pinnedRows$bottom.length) || 0);\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"className\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_useForkRef as useForkRef, unstable_useEnhancedEffect as useEnhancedEffect, unstable_capitalize as capitalize, unstable_composeClasses as composeClasses } from '@mui/utils';\nimport { GridRootStyles } from './GridRootStyles';\nimport { gridVisibleColumnDefinitionsSelector } from '../../hooks/features/columns/gridColumnsSelector';\nimport { useGridSelector } from '../../hooks/utils/useGridSelector';\nimport { useGridPrivateApiContext } from '../../hooks/utils/useGridPrivateApiContext';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { getDataGridUtilityClass } from '../../constants/gridClasses';\nimport { gridDensityValueSelector } from '../../hooks/features/density/densitySelector';\nimport { gridColumnGroupsHeaderMaxDepthSelector } from '../../hooks/features/columnGrouping/gridColumnGroupsSelector';\nimport { gridPinnedRowsCountSelector, gridRowCountSelector } from '../../hooks/features/rows/gridRowsSelector';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n autoHeight,\n density,\n classes\n } = ownerState;\n const slots = {\n root: ['root', autoHeight && 'autoHeight', `root--density${capitalize(density)}`, 'withBorderColor']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {\n const rootProps = useGridRootProps();\n const {\n children,\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const apiRef = useGridPrivateApiContext();\n const visibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);\n const totalRowCount = useGridSelector(apiRef, gridRowCountSelector);\n const densityValue = useGridSelector(apiRef, gridDensityValueSelector);\n const headerGroupingMaxDepth = useGridSelector(apiRef, gridColumnGroupsHeaderMaxDepthSelector);\n const rootContainerRef = React.useRef(null);\n const handleRef = useForkRef(rootContainerRef, ref);\n const pinnedRowsCount = useGridSelector(apiRef, gridPinnedRowsCountSelector);\n const ownerState = _extends({}, rootProps, {\n density: densityValue\n });\n const classes = useUtilityClasses(ownerState);\n apiRef.current.register('public', {\n rootElementRef: rootContainerRef\n });\n\n // Our implementation of \n const [mountedState, setMountedState] = React.useState(false);\n useEnhancedEffect(() => {\n setMountedState(true);\n }, []);\n useEnhancedEffect(() => {\n if (mountedState) {\n apiRef.current.updateGridDimensionsRef();\n }\n }, [apiRef, mountedState]);\n if (!mountedState) {\n return null;\n }\n return /*#__PURE__*/_jsx(GridRootStyles, _extends({\n ref: handleRef,\n className: clsx(className, classes.root),\n ownerState: ownerState,\n role: \"grid\",\n \"aria-colcount\": visibleColumns.length,\n \"aria-rowcount\": headerGroupingMaxDepth + 1 + pinnedRowsCount + totalRowCount,\n \"aria-multiselectable\": !rootProps.disableMultipleRowSelection,\n \"aria-label\": rootProps['aria-label'],\n \"aria-labelledby\": rootProps['aria-labelledby']\n }, other, {\n children: children\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridRoot.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport { GridRoot };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridRootProps } from '../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const GridHeader = /*#__PURE__*/React.forwardRef(function GridHeader(props, ref) {\n var _rootProps$slotProps, _rootProps$slotProps2;\n const rootProps = useGridRootProps();\n return /*#__PURE__*/_jsxs(\"div\", _extends({\n ref: ref\n }, props, {\n children: [/*#__PURE__*/_jsx(rootProps.slots.preferencesPanel, _extends({}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.preferencesPanel)), rootProps.slots.toolbar && /*#__PURE__*/_jsx(rootProps.slots.toolbar, _extends({}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.toolbar))]\n }));\n});","import createStyled from './createStyled';\nconst styled = createStyled();\nexport default styled;","import * as React from 'react';\nimport { unstable_composeClasses as composeClasses } from '@mui/utils';\nimport { styled } from '@mui/system';\nimport { getDataGridUtilityClass } from '../../constants/gridClasses';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['main']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\nconst GridMainContainerRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'Main',\n overridesResolver: (props, styles) => styles.main\n})(() => ({\n position: 'relative',\n flexGrow: 1,\n display: 'flex',\n flexDirection: 'column',\n overflow: 'hidden'\n}));\nexport function GridMainContainer(props) {\n const rootProps = useGridRootProps();\n const classes = useUtilityClasses(rootProps);\n return /*#__PURE__*/_jsx(GridMainContainerRoot, {\n className: classes.root,\n ownerState: rootProps,\n children: props.children\n });\n}","import * as React from 'react';\nimport useEnhancedEffect from './useEnhancedEffect';\n\n/**\n * https://github.com/facebook/react/issues/14099#issuecomment-440013892\n */\nexport default function useEventCallback(fn) {\n const ref = React.useRef(fn);\n useEnhancedEffect(() => {\n ref.current = fn;\n });\n return React.useCallback((...args) =>\n // @ts-expect-error hide `this`\n // tslint:disable-next-line:ban-comma-operator\n (0, ref.current)(...args), []);\n}","export default function ownerDocument(node) {\n return node && node.ownerDocument || document;\n}","import ownerDocument from './ownerDocument';\nexport default function ownerWindow(node) {\n const doc = ownerDocument(node);\n return doc.defaultView || window;\n}","/**\n * Detect Element Resize.\n * https://github.com/sdecima/javascript-detect-element-resize\n * Sebastian Decima\n *\n * Forked from version 0.5.3; includes the following modifications:\n * 1) Guard against unsafe 'window' and 'document' references (to support SSR).\n * 2) Defer initialization code via a top-level function wrapper (to support SSR).\n * 3) Avoid unnecessary reflows by not measuring size for scroll events bubbling from children.\n * 4) Add nonce for style element.\n *\n * TODO replace with https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver\n * once browser support allows it.\n **/\nexport default function createDetectElementResize(nonce, hostWindow) {\n var resetTriggers = function resetTriggers(element) {\n var triggers = element.__resizeTriggers__,\n expand = triggers.firstElementChild,\n contract = triggers.lastElementChild,\n expandChild = expand.firstElementChild;\n contract.scrollLeft = contract.scrollWidth;\n contract.scrollTop = contract.scrollHeight;\n expandChild.style.width = expand.offsetWidth + 1 + 'px';\n expandChild.style.height = expand.offsetHeight + 1 + 'px';\n expand.scrollLeft = expand.scrollWidth;\n expand.scrollTop = expand.scrollHeight;\n };\n var checkTriggers = function checkTriggers(element) {\n return element.offsetWidth != element.__resizeLast__.width || element.offsetHeight != element.__resizeLast__.height;\n };\n var scrollListener = function scrollListener(e) {\n // Don't measure (which forces) reflow for scrolls that happen inside of children!\n if (e.target.className.indexOf('contract-trigger') < 0 && e.target.className.indexOf('expand-trigger') < 0) {\n return;\n }\n var element = this;\n resetTriggers(this);\n if (this.__resizeRAF__) {\n hostWindow.cancelAnimationFrame(this.__resizeRAF__);\n }\n this.__resizeRAF__ = hostWindow.requestAnimationFrame(function () {\n if (checkTriggers(element)) {\n element.__resizeLast__.width = element.offsetWidth;\n element.__resizeLast__.height = element.offsetHeight;\n element.__resizeListeners__.forEach(function (fn) {\n fn.call(element, e);\n });\n }\n });\n };\n\n /* Detect CSS Animations support to detect element display/re-attach */\n var animation = false,\n keyframeprefix = '',\n animationstartevent = 'animationstart',\n domPrefixes = 'Webkit Moz O ms'.split(' '),\n startEvents = 'webkitAnimationStart animationstart oAnimationStart MSAnimationStart'.split(' '),\n pfx = '';\n {\n var elm = document.createElement('fakeelement');\n if (elm.style.animationName !== undefined) {\n animation = true;\n }\n if (animation === false) {\n for (var i = 0; i < domPrefixes.length; i++) {\n if (elm.style[domPrefixes[i] + 'AnimationName'] !== undefined) {\n pfx = domPrefixes[i];\n keyframeprefix = '-' + pfx.toLowerCase() + '-';\n animationstartevent = startEvents[i];\n animation = true;\n break;\n }\n }\n }\n }\n var animationName = 'resizeanim';\n var animationKeyframes = '@' + keyframeprefix + 'keyframes ' + animationName + ' { from { opacity: 0; } to { opacity: 0; } } ';\n var animationStyle = keyframeprefix + 'animation: 1ms ' + animationName + '; ';\n var createStyles = function createStyles(doc, root) {\n if (!root.getElementById('muiDetectElementResize')) {\n //opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360\n var css = (animationKeyframes ? animationKeyframes : '') + '.Mui-resizeTriggers { ' + (animationStyle ? animationStyle : '') + 'visibility: hidden; opacity: 0; } ' + '.Mui-resizeTriggers, .Mui-resizeTriggers > div, .contract-trigger:before { content: \" \"; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .Mui-resizeTriggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',\n container = root.constructor.name === 'ShadowRoot' ? root : doc.head || doc.getElementsByTagName('head')[0],\n style = doc.createElement('style');\n style.id = 'muiDetectElementResize';\n style.type = 'text/css';\n if (nonce != null) {\n style.setAttribute('nonce', nonce);\n }\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(doc.createTextNode(css));\n }\n container.appendChild(style);\n }\n };\n var addResizeListener = function addResizeListener(element, fn) {\n if (!element.__resizeTriggers__) {\n var doc = element.ownerDocument;\n var elementStyle = hostWindow.getComputedStyle(element);\n if (elementStyle && elementStyle.position == 'static') {\n element.style.position = 'relative';\n }\n createStyles(doc, element.getRootNode());\n element.__resizeLast__ = {};\n element.__resizeListeners__ = [];\n (element.__resizeTriggers__ = doc.createElement('div')).className = 'Mui-resizeTriggers';\n element.__resizeTriggers__.innerHTML = '
    ' + '
    ';\n element.appendChild(element.__resizeTriggers__);\n resetTriggers(element);\n element.addEventListener('scroll', scrollListener, true);\n\n /* Listen for a css animation to detect element display/re-attach */\n if (animationstartevent) {\n element.__resizeTriggers__.__animationListener__ = function animationListener(e) {\n if (e.animationName == animationName) {\n resetTriggers(element);\n }\n };\n element.__resizeTriggers__.addEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__);\n }\n }\n element.__resizeListeners__.push(fn);\n };\n var removeResizeListener = function removeResizeListener(element, fn) {\n element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);\n if (!element.__resizeListeners__.length) {\n element.removeEventListener('scroll', scrollListener, true);\n if (element.__resizeTriggers__.__animationListener__) {\n element.__resizeTriggers__.removeEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__);\n element.__resizeTriggers__.__animationListener__ = null;\n }\n try {\n element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);\n } catch (e) {\n // Preact compat; see developit/preact-compat/issues/228\n }\n }\n };\n return {\n addResizeListener,\n removeResizeListener\n };\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"defaultHeight\", \"defaultWidth\", \"disableHeight\", \"disableWidth\", \"nonce\", \"onResize\", \"style\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_useForkRef as useForkRef, unstable_ownerWindow as ownerWindow, unstable_useEventCallback as useEventCallback, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';\nimport createDetectElementResize from '../lib/createDetectElementResize';\n// TODO replace with https://caniuse.com/resizeobserver.\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst GridAutoSizer = /*#__PURE__*/React.forwardRef(function AutoSizer(props, ref) {\n const {\n children,\n defaultHeight = null,\n defaultWidth = null,\n disableHeight = false,\n disableWidth = false,\n nonce,\n onResize,\n style\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const [state, setState] = React.useState({\n height: defaultHeight,\n width: defaultWidth\n });\n const rootRef = React.useRef(null);\n const parentElement = React.useRef(null);\n const handleResize = useEventCallback(() => {\n // Guard against AutoSizer component being removed from the DOM immediately after being added.\n // This can result in invalid style values which can result in NaN values if we don't handle them.\n // See issue #150 for more context.\n if (parentElement.current) {\n const height = parentElement.current.offsetHeight || 0;\n const width = parentElement.current.offsetWidth || 0;\n const win = ownerWindow(parentElement.current);\n const computedStyle = win.getComputedStyle(parentElement.current);\n const paddingLeft = parseInt(computedStyle.paddingLeft, 10) || 0;\n const paddingRight = parseInt(computedStyle.paddingRight, 10) || 0;\n const paddingTop = parseInt(computedStyle.paddingTop, 10) || 0;\n const paddingBottom = parseInt(computedStyle.paddingBottom, 10) || 0;\n const newHeight = height - paddingTop - paddingBottom;\n const newWidth = width - paddingLeft - paddingRight;\n if (!disableHeight && state.height !== newHeight || !disableWidth && state.width !== newWidth) {\n setState({\n height: newHeight,\n width: newWidth\n });\n if (onResize) {\n onResize({\n height: newHeight,\n width: newWidth\n });\n }\n }\n }\n });\n useEnhancedEffect(() => {\n var _parentElement$curren;\n parentElement.current = rootRef.current.parentElement;\n if (!parentElement) {\n return undefined;\n }\n const win = ownerWindow((_parentElement$curren = parentElement.current) != null ? _parentElement$curren : undefined);\n const detectElementResize = createDetectElementResize(nonce, win);\n detectElementResize.addResizeListener(parentElement.current, handleResize);\n handleResize();\n return () => {\n detectElementResize.removeResizeListener(parentElement.current, handleResize);\n };\n }, [nonce, handleResize]);\n const handleRef = useForkRef(rootRef, ref);\n return /*#__PURE__*/_jsx(\"div\", _extends({\n ref: handleRef,\n style: _extends({\n flex: disableHeight ? 0 : '1 1 0px',\n overflow: disableHeight ? 'visible' : 'auto'\n }, style)\n }, other, {\n children: state.height === null && state.width === null ? null : children\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridAutoSizer.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n /**\n * Function responsible for rendering children.\n * @param {AutoSizerSize} size The grid's size.\n * @returns {React.ReactNode} The children to render.\n */\n children: PropTypes.node,\n /**\n * Default height to use for initial render; useful for SSR.\n * @default null\n */\n defaultHeight: PropTypes.number,\n /**\n * Default width to use for initial render; useful for SSR.\n * @default null\n */\n defaultWidth: PropTypes.number,\n /**\n * If `true`, disable dynamic :height property.\n * @default false\n */\n disableHeight: PropTypes.bool,\n /**\n * If `true`, disable dynamic :width property.\n * @default false\n */\n disableWidth: PropTypes.bool,\n /**\n * Nonce of the inlined stylesheet for Content Security Policy.\n */\n nonce: PropTypes.string,\n /**\n * Callback to be invoked on-resize.\n * @param {AutoSizerSize} size The grid's size.\n */\n onResize: PropTypes.func\n} : void 0;\nexport { GridAutoSizer };","import { createSelector } from '../../../utils/createSelector';\nimport { gridRowsLookupSelector } from '../rows/gridRowsSelector';\n\n/**\n * @category Sorting\n * @ignore - do not document.\n */\nconst gridSortingStateSelector = state => state.sorting;\n\n/**\n * Get the id of the rows after the sorting process.\n * @category Sorting\n */\nexport const gridSortedRowIdsSelector = createSelector(gridSortingStateSelector, sortingState => sortingState.sortedRows);\n\n/**\n * Get the id and the model of the rows after the sorting process.\n * @category Sorting\n */\nexport const gridSortedRowEntriesSelector = createSelector(gridSortedRowIdsSelector, gridRowsLookupSelector,\n// TODO rows v6: Is this the best approach ?\n(sortedIds, idRowsLookup) => sortedIds.map(id => {\n var _idRowsLookup$id;\n return {\n id,\n model: (_idRowsLookup$id = idRowsLookup[id]) != null ? _idRowsLookup$id : {}\n };\n}));\n\n/**\n * Get the current sorting model.\n * @category Sorting\n */\nexport const gridSortModelSelector = createSelector(gridSortingStateSelector, sorting => sorting.sortModel);\n/**\n * @category Sorting\n * @ignore - do not document.\n */\nexport const gridSortColumnLookupSelector = createSelector(gridSortModelSelector, sortModel => {\n const result = sortModel.reduce((res, sortItem, index) => {\n res[sortItem.field] = {\n sortDirection: sortItem.sort,\n sortIndex: sortModel.length > 1 ? index + 1 : undefined\n };\n return res;\n }, {});\n return result;\n});","import { createSelector } from '../../../utils/createSelector';\nimport { gridSortedRowEntriesSelector } from '../sorting/gridSortingSelector';\nimport { gridColumnLookupSelector } from '../columns/gridColumnsSelector';\nimport { gridRowMaximumTreeDepthSelector, gridRowTreeSelector } from '../rows/gridRowsSelector';\n\n/**\n * @category Filtering\n */\nconst gridFilterStateSelector = state => state.filter;\n\n/**\n * Get the current filter model.\n * @category Filtering\n */\nexport const gridFilterModelSelector = createSelector(gridFilterStateSelector, filterState => filterState.filterModel);\n\n/**\n * Get the current quick filter values.\n * @category Filtering\n */\nexport const gridQuickFilterValuesSelector = createSelector(gridFilterModelSelector, filterModel => filterModel.quickFilterValues);\n\n/**\n * @category Filtering\n * @ignore - do not document.\n */\nexport const gridVisibleRowsLookupSelector = createSelector(gridFilterStateSelector, filterState => filterState.visibleRowsLookup);\n\n/**\n * @category Filtering\n * @ignore - do not document.\n */\nexport const gridFilteredRowsLookupSelector = createSelector(gridFilterStateSelector, filterState => filterState.filteredRowsLookup);\n\n/**\n * @category Filtering\n * @ignore - do not document.\n */\nexport const gridFilteredDescendantCountLookupSelector = createSelector(gridFilterStateSelector, filterState => filterState.filteredDescendantCountLookup);\n\n/**\n * Get the id and the model of the rows accessible after the filtering process.\n * Does not contain the collapsed children.\n * @category Filtering\n */\nexport const gridExpandedSortedRowEntriesSelector = createSelector(gridVisibleRowsLookupSelector, gridSortedRowEntriesSelector, (visibleRowsLookup, sortedRows) => sortedRows.filter(row => visibleRowsLookup[row.id] !== false));\n\n/**\n * Get the id of the rows accessible after the filtering process.\n * Does not contain the collapsed children.\n * @category Filtering\n */\nexport const gridExpandedSortedRowIdsSelector = createSelector(gridExpandedSortedRowEntriesSelector, visibleSortedRowEntries => visibleSortedRowEntries.map(row => row.id));\n\n/**\n * Get the id and the model of the rows accessible after the filtering process.\n * Contains the collapsed children.\n * @category Filtering\n */\nexport const gridFilteredSortedRowEntriesSelector = createSelector(gridFilteredRowsLookupSelector, gridSortedRowEntriesSelector, (filteredRowsLookup, sortedRows) => sortedRows.filter(row => filteredRowsLookup[row.id] !== false));\n\n/**\n * Get the id of the rows accessible after the filtering process.\n * Contains the collapsed children.\n * @category Filtering\n */\nexport const gridFilteredSortedRowIdsSelector = createSelector(gridFilteredSortedRowEntriesSelector, filteredSortedRowEntries => filteredSortedRowEntries.map(row => row.id));\n\n/**\n * Get the id and the model of the top level rows accessible after the filtering process.\n * @category Filtering\n */\nexport const gridFilteredSortedTopLevelRowEntriesSelector = createSelector(gridExpandedSortedRowEntriesSelector, gridRowTreeSelector, gridRowMaximumTreeDepthSelector, (visibleSortedRows, rowTree, rowTreeDepth) => {\n if (rowTreeDepth < 2) {\n return visibleSortedRows;\n }\n return visibleSortedRows.filter(row => {\n var _rowTree$row$id;\n return ((_rowTree$row$id = rowTree[row.id]) == null ? void 0 : _rowTree$row$id.depth) === 0;\n });\n});\n\n/**\n * Get the amount of rows accessible after the filtering process.\n * @category Filtering\n */\nexport const gridExpandedRowCountSelector = createSelector(gridExpandedSortedRowEntriesSelector, visibleSortedRows => visibleSortedRows.length);\n\n/**\n * Get the amount of top level rows accessible after the filtering process.\n * @category Filtering\n */\nexport const gridFilteredTopLevelRowCountSelector = createSelector(gridFilteredSortedTopLevelRowEntriesSelector, visibleSortedTopLevelRows => visibleSortedTopLevelRows.length);\n\n/**\n * @category Filtering\n * @ignore - do not document.\n */\nexport const gridFilterActiveItemsSelector = createSelector(gridFilterModelSelector, gridColumnLookupSelector, (filterModel, columnLookup) => {\n var _filterModel$items;\n return (_filterModel$items = filterModel.items) == null ? void 0 : _filterModel$items.filter(item => {\n var _column$filterOperato, _item$value;\n if (!item.field) {\n return false;\n }\n const column = columnLookup[item.field];\n if (!(column != null && column.filterOperators) || (column == null ? void 0 : (_column$filterOperato = column.filterOperators) == null ? void 0 : _column$filterOperato.length) === 0) {\n return false;\n }\n const filterOperator = column.filterOperators.find(operator => operator.value === item.operator);\n if (!filterOperator) {\n return false;\n }\n return !filterOperator.InputComponent || item.value != null && ((_item$value = item.value) == null ? void 0 : _item$value.toString()) !== '';\n });\n});\n/**\n * @category Filtering\n * @ignore - do not document.\n */\nexport const gridFilterActiveItemsLookupSelector = createSelector(gridFilterActiveItemsSelector, activeFilters => {\n const result = activeFilters.reduce((res, filterItem) => {\n if (!res[filterItem.field]) {\n res[filterItem.field] = [filterItem];\n } else {\n res[filterItem.field].push(filterItem);\n }\n return res;\n }, {});\n return result;\n});","import { createSelector } from '../../../utils/createSelector';\nexport const gridFocusStateSelector = state => state.focus;\nexport const gridFocusCellSelector = createSelector(gridFocusStateSelector, focusState => focusState.cell);\nexport const gridFocusColumnHeaderSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnHeader);\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const unstable_gridFocusColumnGroupHeaderSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnGroupHeader);\nexport const gridTabIndexStateSelector = state => state.tabIndex;\nexport const gridTabIndexCellSelector = createSelector(gridTabIndexStateSelector, state => state.cell);\nexport const gridTabIndexColumnHeaderSelector = createSelector(gridTabIndexStateSelector, state => state.columnHeader);\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const unstable_gridTabIndexColumnGroupHeaderSelector = createSelector(gridTabIndexStateSelector, state => state.columnGroupHeader);","export const gridColumnMenuSelector = state => state.columnMenu;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { useGridPrivateApiContext } from '../../hooks/utils/useGridPrivateApiContext';\nimport { useGridSelector } from '../../hooks/utils/useGridSelector';\nimport { GridMainContainer } from '../containers/GridMainContainer';\nimport { GridAutoSizer } from '../GridAutoSizer';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { gridColumnPositionsSelector, gridColumnVisibilityModelSelector, gridVisibleColumnDefinitionsSelector } from '../../hooks/features/columns/gridColumnsSelector';\nimport { gridFilterActiveItemsLookupSelector } from '../../hooks/features/filter/gridFilterSelector';\nimport { gridSortColumnLookupSelector } from '../../hooks/features/sorting/gridSortingSelector';\nimport { gridTabIndexColumnHeaderSelector, gridTabIndexCellSelector, gridFocusColumnHeaderSelector, unstable_gridTabIndexColumnGroupHeaderSelector, unstable_gridFocusColumnGroupHeaderSelector } from '../../hooks/features/focus/gridFocusStateSelector';\nimport { gridDensityFactorSelector } from '../../hooks/features/density/densitySelector';\nimport { gridColumnGroupsHeaderMaxDepthSelector, gridColumnGroupsHeaderStructureSelector } from '../../hooks/features/columnGrouping/gridColumnGroupsSelector';\nimport { gridColumnMenuSelector } from '../../hooks/features/columnMenu/columnMenuSelector';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction GridBody(props) {\n const {\n children,\n VirtualScrollerComponent,\n ColumnHeadersProps\n } = props;\n const apiRef = useGridPrivateApiContext();\n const rootProps = useGridRootProps();\n const visibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);\n const filterColumnLookup = useGridSelector(apiRef, gridFilterActiveItemsLookupSelector);\n const sortColumnLookup = useGridSelector(apiRef, gridSortColumnLookupSelector);\n const columnPositions = useGridSelector(apiRef, gridColumnPositionsSelector);\n const columnHeaderTabIndexState = useGridSelector(apiRef, gridTabIndexColumnHeaderSelector);\n const cellTabIndexState = useGridSelector(apiRef, gridTabIndexCellSelector);\n const columnGroupHeaderTabIndexState = useGridSelector(apiRef, unstable_gridTabIndexColumnGroupHeaderSelector);\n const columnHeaderFocus = useGridSelector(apiRef, gridFocusColumnHeaderSelector);\n const columnGroupHeaderFocus = useGridSelector(apiRef, unstable_gridFocusColumnGroupHeaderSelector);\n const densityFactor = useGridSelector(apiRef, gridDensityFactorSelector);\n const headerGroupingMaxDepth = useGridSelector(apiRef, gridColumnGroupsHeaderMaxDepthSelector);\n const columnMenuState = useGridSelector(apiRef, gridColumnMenuSelector);\n const columnVisibility = useGridSelector(apiRef, gridColumnVisibilityModelSelector);\n const columnGroupsHeaderStructure = useGridSelector(apiRef, gridColumnGroupsHeaderStructureSelector);\n const hasOtherElementInTabSequence = !(columnGroupHeaderTabIndexState === null && columnHeaderTabIndexState === null && cellTabIndexState === null);\n const [isVirtualizationDisabled, setIsVirtualizationDisabled] = React.useState(rootProps.disableVirtualization);\n const disableVirtualization = React.useCallback(() => {\n setIsVirtualizationDisabled(true);\n }, []);\n const enableVirtualization = React.useCallback(() => {\n setIsVirtualizationDisabled(false);\n }, []);\n React.useEffect(() => {\n setIsVirtualizationDisabled(rootProps.disableVirtualization);\n }, [rootProps.disableVirtualization]);\n\n // The `useGridApiMethod` hook can't be used here, because it only installs the\n // method if it doesn't exist yet. Once installed, it's never updated again.\n // This break the methods above, since their closure comes from the first time\n // they were installed. Which means that calling `setIsVirtualizationDisabled`\n // will trigger a re-render, but it won't update the state. That can be solved\n // by migrating the virtualization status to the global state.\n apiRef.current.unstable_disableVirtualization = disableVirtualization;\n apiRef.current.unstable_enableVirtualization = enableVirtualization;\n const columnHeadersRef = React.useRef(null);\n const columnsContainerRef = React.useRef(null);\n const virtualScrollerRef = React.useRef(null);\n apiRef.current.register('private', {\n columnHeadersContainerElementRef: columnsContainerRef,\n columnHeadersElementRef: columnHeadersRef,\n virtualScrollerRef\n });\n const handleResize = React.useCallback(size => {\n apiRef.current.publishEvent('resize', size);\n }, [apiRef]);\n return /*#__PURE__*/_jsxs(GridMainContainer, {\n children: [/*#__PURE__*/_jsx(rootProps.slots.columnHeaders, _extends({\n ref: columnsContainerRef,\n innerRef: columnHeadersRef,\n visibleColumns: visibleColumns,\n filterColumnLookup: filterColumnLookup,\n sortColumnLookup: sortColumnLookup,\n columnPositions: columnPositions,\n columnHeaderTabIndexState: columnHeaderTabIndexState,\n columnGroupHeaderTabIndexState: columnGroupHeaderTabIndexState,\n columnHeaderFocus: columnHeaderFocus,\n columnGroupHeaderFocus: columnGroupHeaderFocus,\n densityFactor: densityFactor,\n headerGroupingMaxDepth: headerGroupingMaxDepth,\n columnMenuState: columnMenuState,\n columnVisibility: columnVisibility,\n columnGroupsHeaderStructure: columnGroupsHeaderStructure,\n hasOtherElementInTabSequence: hasOtherElementInTabSequence\n }, ColumnHeadersProps)), /*#__PURE__*/_jsx(GridAutoSizer, {\n nonce: rootProps.nonce,\n disableHeight: rootProps.autoHeight,\n onResize: handleResize,\n children: /*#__PURE__*/_jsx(VirtualScrollerComponent, {\n ref: virtualScrollerRef,\n disableVirtualization: isVirtualizationDisabled\n })\n }), children]\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GridBody.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n children: PropTypes.node,\n ColumnHeadersProps: PropTypes.object,\n VirtualScrollerComponent: PropTypes.elementType.isRequired\n} : void 0;\nexport { GridBody };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function GridFooterPlaceholder() {\n var _rootProps$slotProps;\n const rootProps = useGridRootProps();\n if (rootProps.hideFooter) {\n return null;\n }\n return /*#__PURE__*/_jsx(rootProps.slots.footer, _extends({}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.footer));\n}","import * as React from 'react';\nexport const GridApiContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== 'production') {\n GridApiContext.displayName = 'GridApiContext';\n}","import * as React from 'react';\nimport { GridApiContext } from '../components/GridApiContext';\nimport { GridPrivateApiContext } from '../hooks/utils/useGridPrivateApiContext';\nimport { GridRootPropsContext } from './GridRootPropsContext';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function GridContextProvider({\n privateApiRef,\n props,\n children\n}) {\n const apiRef = React.useRef(privateApiRef.current.getPublicApi());\n return /*#__PURE__*/_jsx(GridRootPropsContext.Provider, {\n value: props,\n children: /*#__PURE__*/_jsx(GridPrivateApiContext.Provider, {\n value: privateApiRef,\n children: /*#__PURE__*/_jsx(GridApiContext.Provider, {\n value: apiRef,\n children: children\n })\n })\n });\n}","export function isNumber(value) {\n return typeof value === 'number';\n}\nexport function isFunction(value) {\n return typeof value === 'function';\n}\nexport function isObject(value) {\n return typeof value === 'object' && value !== null;\n}\nexport function localStorageAvailable() {\n try {\n // Incognito mode might reject access to the localStorage for security reasons.\n // window isn't defined on Node.js\n // https://stackoverflow.com/questions/16427636/check-if-localstorage-is-available\n const key = '__some_random_key_you_are_not_going_to_use__';\n window.localStorage.setItem(key, key);\n window.localStorage.removeItem(key);\n return true;\n } catch (err) {\n return false;\n }\n}\nexport function escapeRegExp(value) {\n return value.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n}\n\n/**\n * Follows the CSS specification behavior for min and max\n * If min > max, then the min have priority\n */\nexport const clamp = (value, min, max) => Math.max(min, Math.min(max, value));\n\n/**\n * Based on `fast-deep-equal`\n *\n * MIT License\n *\n * Copyright (c) 2017 Evgeny Poberezkin\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * We only type the public interface to avoid dozens of `as` in the function.\n */\n\nexport function isDeepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n if (a.constructor !== b.constructor) {\n return false;\n }\n if (Array.isArray(a)) {\n const length = a.length;\n if (length !== b.length) {\n return false;\n }\n for (let i = 0; i < length; i += 1) {\n if (!isDeepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n if (a instanceof Map && b instanceof Map) {\n if (a.size !== b.size) {\n return false;\n }\n const entriesA = Array.from(a.entries());\n for (let i = 0; i < entriesA.length; i += 1) {\n if (!b.has(entriesA[i][0])) {\n return false;\n }\n }\n for (let i = 0; i < entriesA.length; i += 1) {\n const entryA = entriesA[i];\n if (!isDeepEqual(entryA[1], b.get(entryA[0]))) {\n return false;\n }\n }\n return true;\n }\n if (a instanceof Set && b instanceof Set) {\n if (a.size !== b.size) {\n return false;\n }\n const entries = Array.from(a.entries());\n for (let i = 0; i < entries.length; i += 1) {\n if (!b.has(entries[i][0])) {\n return false;\n }\n }\n return true;\n }\n if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n const length = a.length;\n if (length !== b.length) {\n return false;\n }\n for (let i = 0; i < length; i += 1) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n }\n if (a.constructor === RegExp) {\n return a.source === b.source && a.flags === b.flags;\n }\n if (a.valueOf !== Object.prototype.valueOf) {\n return a.valueOf() === b.valueOf();\n }\n if (a.toString !== Object.prototype.toString) {\n return a.toString() === b.toString();\n }\n const keys = Object.keys(a);\n const length = keys.length;\n if (length !== Object.keys(b).length) {\n return false;\n }\n for (let i = 0; i < length; i += 1) {\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) {\n return false;\n }\n }\n for (let i = 0; i < length; i += 1) {\n const key = keys[i];\n if (!isDeepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n\n // true if both NaN, false otherwise\n // eslint-disable-next-line no-self-compare\n return a !== a && b !== b;\n}\n\n// Pseudo random number. See https://stackoverflow.com/a/47593316\nfunction mulberry32(a) {\n return () => {\n /* eslint-disable */\n let t = a += 0x6d2b79f5;\n t = Math.imul(t ^ t >>> 15, t | 1);\n t ^= t + Math.imul(t ^ t >>> 7, t | 61);\n return ((t ^ t >>> 14) >>> 0) / 4294967296;\n /* eslint-enable */\n };\n}\n\nexport function randomNumberBetween(seed, min, max) {\n const random = mulberry32(seed);\n return () => min + (max - min) * random();\n}\nexport function deepClone(obj) {\n if (typeof structuredClone === 'function') {\n return structuredClone(obj);\n }\n return JSON.parse(JSON.stringify(obj));\n}","import * as React from 'react';\nexport function useGridApiMethod(privateApiRef, apiMethods, visibility) {\n const apiMethodsRef = React.useRef(apiMethods);\n const [apiMethodsNames] = React.useState(Object.keys(apiMethods));\n const installMethods = React.useCallback(() => {\n if (!privateApiRef.current) {\n return;\n }\n apiMethodsNames.forEach(methodName => {\n if (!privateApiRef.current.hasOwnProperty(methodName)) {\n privateApiRef.current.register(visibility, {\n [methodName]: (...args) => {\n const fn = apiMethodsRef.current[methodName];\n return fn(...args);\n }\n });\n }\n });\n }, [apiMethodsNames, privateApiRef, visibility]);\n React.useEffect(() => {\n apiMethodsRef.current = apiMethods;\n }, [apiMethods]);\n React.useEffect(() => {\n installMethods();\n }, [installMethods]);\n installMethods();\n}","import * as React from 'react';\nimport { localStorageAvailable } from '../../utils/utils';\nimport { useGridApiMethod } from '../utils';\nconst forceDebug = localStorageAvailable() && window.localStorage.getItem('DEBUG') != null;\nconst noop = () => {};\nconst noopLogger = {\n debug: noop,\n info: noop,\n warn: noop,\n error: noop\n};\nconst LOG_LEVELS = ['debug', 'info', 'warn', 'error'];\nfunction getAppender(name, logLevel, appender = console) {\n const minLogLevelIdx = LOG_LEVELS.indexOf(logLevel);\n if (minLogLevelIdx === -1) {\n throw new Error(`MUI: Log level ${logLevel} not recognized.`);\n }\n const logger = LOG_LEVELS.reduce((loggerObj, method, idx) => {\n if (idx >= minLogLevelIdx) {\n loggerObj[method] = (...args) => {\n const [message, ...other] = args;\n appender[method](`MUI: ${name} - ${message}`, ...other);\n };\n } else {\n loggerObj[method] = noop;\n }\n return loggerObj;\n }, {});\n return logger;\n}\nexport const useGridLoggerFactory = (apiRef, props) => {\n const getLogger = React.useCallback(name => {\n if (forceDebug) {\n return getAppender(name, 'debug', props.logger);\n }\n if (!props.logLevel) {\n return noopLogger;\n }\n return getAppender(name, props.logLevel.toString(), props.logger);\n }, [props.logLevel, props.logger]);\n useGridApiMethod(apiRef, {\n getLogger\n }, 'private');\n};","import * as React from 'react';\nimport { TimerBasedCleanupTracking } from '../../utils/cleanupTracking/TimerBasedCleanupTracking';\nimport { FinalizationRegistryBasedCleanupTracking } from '../../utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking';\n/**\n * Signal to the underlying logic what version of the public component API\n * of the data grid is exposed.\n */\nvar GridSignature;\n(function (GridSignature) {\n GridSignature[\"DataGrid\"] = \"DataGrid\";\n GridSignature[\"DataGridPro\"] = \"DataGridPro\";\n})(GridSignature || (GridSignature = {}));\n// We use class to make it easier to detect in heap snapshots by name\nclass ObjectToBeRetainedByReact {}\n\n// Based on https://github.com/Bnaya/use-dispose-uncommitted/blob/main/src/finalization-registry-based-impl.ts\n// Check https://github.com/facebook/react/issues/15317 to get more information\nexport function createUseGridApiEventHandler(registryContainer) {\n let cleanupTokensCounter = 0;\n return function useGridApiEventHandler(apiRef, eventName, handler, options) {\n if (registryContainer.registry === null) {\n registryContainer.registry = typeof FinalizationRegistry !== 'undefined' ? new FinalizationRegistryBasedCleanupTracking() : new TimerBasedCleanupTracking();\n }\n const [objectRetainedByReact] = React.useState(new ObjectToBeRetainedByReact());\n const subscription = React.useRef(null);\n const handlerRef = React.useRef();\n handlerRef.current = handler;\n const cleanupTokenRef = React.useRef(null);\n if (!subscription.current && handlerRef.current) {\n const enhancedHandler = (params, event, details) => {\n if (!event.defaultMuiPrevented) {\n var _handlerRef$current;\n (_handlerRef$current = handlerRef.current) == null ? void 0 : _handlerRef$current.call(handlerRef, params, event, details);\n }\n };\n subscription.current = apiRef.current.subscribeEvent(eventName, enhancedHandler, options);\n cleanupTokensCounter += 1;\n cleanupTokenRef.current = {\n cleanupToken: cleanupTokensCounter\n };\n registryContainer.registry.register(objectRetainedByReact,\n // The callback below will be called once this reference stops being retained\n () => {\n var _subscription$current;\n (_subscription$current = subscription.current) == null ? void 0 : _subscription$current.call(subscription);\n subscription.current = null;\n cleanupTokenRef.current = null;\n }, cleanupTokenRef.current);\n } else if (!handlerRef.current && subscription.current) {\n subscription.current();\n subscription.current = null;\n if (cleanupTokenRef.current) {\n registryContainer.registry.unregister(cleanupTokenRef.current);\n cleanupTokenRef.current = null;\n }\n }\n React.useEffect(() => {\n if (!subscription.current && handlerRef.current) {\n const enhancedHandler = (params, event, details) => {\n if (!event.defaultMuiPrevented) {\n var _handlerRef$current2;\n (_handlerRef$current2 = handlerRef.current) == null ? void 0 : _handlerRef$current2.call(handlerRef, params, event, details);\n }\n };\n subscription.current = apiRef.current.subscribeEvent(eventName, enhancedHandler, options);\n }\n if (cleanupTokenRef.current && registryContainer.registry) {\n // If the effect was called, it means that this render was committed\n // so we can trust the cleanup function to remove the listener.\n registryContainer.registry.unregister(cleanupTokenRef.current);\n cleanupTokenRef.current = null;\n }\n return () => {\n var _subscription$current2;\n (_subscription$current2 = subscription.current) == null ? void 0 : _subscription$current2.call(subscription);\n subscription.current = null;\n };\n }, [apiRef, eventName, options]);\n };\n}\nconst registryContainer = {\n registry: null\n};\n\n// TODO: move to @mui/x-data-grid/internals\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const unstable_resetCleanupTracking = () => {\n var _registryContainer$re;\n (_registryContainer$re = registryContainer.registry) == null ? void 0 : _registryContainer$re.reset();\n registryContainer.registry = null;\n};\nexport const useGridApiEventHandler = createUseGridApiEventHandler(registryContainer);\nconst optionsSubscriberOptions = {\n isFirst: true\n};\nexport function useGridApiOptionHandler(apiRef, eventName, handler) {\n // Validate that only one per event name?\n useGridApiEventHandler(apiRef, eventName, handler, optionsSubscriberOptions);\n}\nexport { GridSignature };","// If no effect ran after this amount of time, we assume that the render was not committed by React\nconst CLEANUP_TIMER_LOOP_MILLIS = 1000;\nexport class TimerBasedCleanupTracking {\n constructor(timeout = CLEANUP_TIMER_LOOP_MILLIS) {\n this.timeouts = new Map();\n this.cleanupTimeout = CLEANUP_TIMER_LOOP_MILLIS;\n this.cleanupTimeout = timeout;\n }\n register(object, unsubscribe, unregisterToken) {\n if (!this.timeouts) {\n this.timeouts = new Map();\n }\n const timeout = setTimeout(() => {\n if (typeof unsubscribe === 'function') {\n unsubscribe();\n }\n this.timeouts.delete(unregisterToken.cleanupToken);\n }, this.cleanupTimeout);\n this.timeouts.set(unregisterToken.cleanupToken, timeout);\n }\n unregister(unregisterToken) {\n const timeout = this.timeouts.get(unregisterToken.cleanupToken);\n if (timeout) {\n this.timeouts.delete(unregisterToken.cleanupToken);\n clearTimeout(timeout);\n }\n }\n reset() {\n if (this.timeouts) {\n this.timeouts.forEach((value, key) => {\n this.unregister({\n cleanupToken: key\n });\n });\n this.timeouts = undefined;\n }\n }\n}","export class FinalizationRegistryBasedCleanupTracking {\n constructor() {\n this.registry = new FinalizationRegistry(unsubscribe => {\n if (typeof unsubscribe === 'function') {\n unsubscribe();\n }\n });\n }\n register(object, unsubscribe, unregisterToken) {\n this.registry.register(object, unsubscribe, unregisterToken);\n }\n unregister(unregisterToken) {\n this.registry.unregister(unregisterToken);\n }\n\n // eslint-disable-next-line class-methods-use-this\n reset() {}\n}","// Used https://gist.github.com/mudge/5830382 as a starting point.\n// See https://github.com/browserify/events/blob/master/events.js for\n// the Node.js (https://nodejs.org/api/events.html) polyfill used by webpack.\nexport class EventManager {\n constructor() {\n this.maxListeners = 10;\n this.warnOnce = false;\n this.events = {};\n }\n on(eventName, listener, options = {}) {\n let collection = this.events[eventName];\n if (!collection) {\n collection = {\n highPriority: new Map(),\n regular: new Map()\n };\n this.events[eventName] = collection;\n }\n if (options.isFirst) {\n collection.highPriority.set(listener, true);\n } else {\n collection.regular.set(listener, true);\n }\n if (process.env.NODE_ENV !== 'production') {\n const collectionSize = collection.highPriority.size + collection.regular.size;\n if (collectionSize > this.maxListeners && !this.warnOnce) {\n this.warnOnce = true;\n console.warn([`Possible EventEmitter memory leak detected. ${collectionSize} ${eventName} listeners added.`, `Use emitter.setMaxListeners() to increase limit.`].join('\\n'));\n }\n }\n }\n removeListener(eventName, listener) {\n if (this.events[eventName]) {\n this.events[eventName].regular.delete(listener);\n this.events[eventName].highPriority.delete(listener);\n }\n }\n removeAllListeners() {\n this.events = {};\n }\n emit(eventName, ...args) {\n const collection = this.events[eventName];\n if (!collection) {\n return;\n }\n const highPriorityListeners = Array.from(collection.highPriority.keys());\n const regularListeners = Array.from(collection.regular.keys());\n for (let i = highPriorityListeners.length - 1; i >= 0; i -= 1) {\n const listener = highPriorityListeners[i];\n if (collection.highPriority.has(listener)) {\n listener.apply(this, args);\n }\n }\n for (let i = 0; i < regularListeners.length; i += 1) {\n const listener = regularListeners[i];\n if (collection.regular.has(listener)) {\n listener.apply(this, args);\n }\n }\n }\n once(eventName, listener) {\n // eslint-disable-next-line consistent-this\n const that = this;\n this.on(eventName, function oneTimeListener(...args) {\n that.removeListener(eventName, oneTimeListener);\n listener.apply(that, args);\n });\n }\n}","import * as React from 'react';\nimport { useGridApiMethod } from '../utils/useGridApiMethod';\nimport { GridSignature } from '../utils/useGridApiEventHandler';\nimport { EventManager } from '../../utils/EventManager';\nimport { unstable_resetCreateSelectorCache } from '../../utils/createSelector';\nconst isSyntheticEvent = event => {\n return event.isPropagationStopped !== undefined;\n};\nlet globalId = 0;\nconst wrapPublicApi = publicApi => {\n const privateOnlyApi = {};\n privateOnlyApi.getPublicApi = () => publicApi;\n privateOnlyApi.register = (visibility, methods) => {\n Object.keys(methods).forEach(methodName => {\n if (visibility === 'public') {\n publicApi[methodName] = methods[methodName];\n } else {\n privateOnlyApi[methodName] = methods[methodName];\n }\n });\n };\n const handler = {\n get: (obj, prop) => {\n if (prop in obj) {\n return obj[prop];\n }\n return privateOnlyApi[prop];\n },\n set: (obj, prop, value) => {\n obj[prop] = value;\n return true;\n }\n };\n return new Proxy(publicApi, handler);\n};\nexport function useGridApiInitialization(inputApiRef, props) {\n const publicApiRef = React.useRef();\n if (!publicApiRef.current) {\n publicApiRef.current = {\n state: {},\n instanceId: globalId\n };\n globalId += 1;\n }\n const privateApiRef = React.useRef();\n if (!privateApiRef.current) {\n privateApiRef.current = wrapPublicApi(publicApiRef.current);\n privateApiRef.current.register('private', {\n caches: {},\n eventManager: new EventManager()\n });\n }\n React.useImperativeHandle(inputApiRef, () => publicApiRef.current, [publicApiRef]);\n const publishEvent = React.useCallback((...args) => {\n const [name, params, event = {}] = args;\n event.defaultMuiPrevented = false;\n if (isSyntheticEvent(event) && event.isPropagationStopped()) {\n return;\n }\n const details = props.signature === GridSignature.DataGridPro ? {\n api: privateApiRef.current.getPublicApi()\n } : {};\n privateApiRef.current.eventManager.emit(name, params, event, details);\n }, [privateApiRef, props.signature]);\n const subscribeEvent = React.useCallback((event, handler, options) => {\n privateApiRef.current.eventManager.on(event, handler, options);\n const api = privateApiRef.current;\n return () => {\n api.eventManager.removeListener(event, handler);\n };\n }, [privateApiRef]);\n useGridApiMethod(privateApiRef, {\n subscribeEvent,\n publishEvent\n }, 'public');\n React.useEffect(() => {\n const api = privateApiRef.current;\n return () => {\n unstable_resetCreateSelectorCache(api.instanceId);\n api.publishEvent('unmount');\n };\n }, [privateApiRef]);\n return privateApiRef;\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _toPropertyKey from \"@babel/runtime/helpers/esm/toPropertyKey\";\nimport * as React from 'react';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\n/**\n * Implement the Pipeline Pattern\n *\n * More information and detailed example in (TODO add link to technical doc when ready)\n *\n * Some plugins contains custom logic to enrich data provided by other plugins or components.\n * For instance, the row grouping plugin needs to add / remove the grouping columns when the grid columns are updated.\n *\n * =====================================================================================================================\n *\n * The plugin containing the custom logic must use:\n *\n * - `useGridRegisterPipeProcessor` to register their processor.\n *\n * - `apiRef.current.requestPipeProcessorsApplication` to imperatively re-apply a group.\n * This method should be used in last resort.\n * Most of the time, the application should be triggered by an update on the deps of the processor.\n *\n * =====================================================================================================================\n *\n * The plugin or component that needs to enrich its data must use:\n *\n * - `apiRef.current.unstable_applyPipeProcessors` to run in chain all the processors of a given group.\n *\n * - `useGridRegisterPipeApplier` to re-apply the whole pipe when requested.\n * The applier will be called when:\n * * a processor is registered.\n * * `apiRef.current.requestPipeProcessorsApplication` is called for the given group.\n */\nexport const useGridPipeProcessing = apiRef => {\n const processorsCache = React.useRef({});\n const runAppliers = React.useCallback(groupCache => {\n if (!groupCache) {\n return;\n }\n Object.values(groupCache.appliers).forEach(callback => {\n callback();\n });\n }, []);\n const registerPipeProcessor = React.useCallback((group, id, processor) => {\n if (!processorsCache.current[group]) {\n processorsCache.current[group] = {\n processors: new Map(),\n appliers: {}\n };\n }\n const groupCache = processorsCache.current[group];\n const oldProcessor = groupCache.processors.get(id);\n if (oldProcessor !== processor) {\n groupCache.processors.set(id, processor);\n runAppliers(groupCache);\n }\n return () => {\n processorsCache.current[group].processors.set(id, null);\n };\n }, [runAppliers]);\n const registerPipeApplier = React.useCallback((group, id, applier) => {\n if (!processorsCache.current[group]) {\n processorsCache.current[group] = {\n processors: new Map(),\n appliers: {}\n };\n }\n processorsCache.current[group].appliers[id] = applier;\n return () => {\n const _appliers = processorsCache.current[group].appliers,\n otherAppliers = _objectWithoutPropertiesLoose(_appliers, [id].map(_toPropertyKey));\n processorsCache.current[group].appliers = otherAppliers;\n };\n }, []);\n const requestPipeProcessorsApplication = React.useCallback(group => {\n const groupCache = processorsCache.current[group];\n runAppliers(groupCache);\n }, [runAppliers]);\n const applyPipeProcessors = React.useCallback((...args) => {\n const [group, value, context] = args;\n if (!processorsCache.current[group]) {\n return value;\n }\n const preProcessors = Array.from(processorsCache.current[group].processors.values());\n return preProcessors.reduce((acc, preProcessor) => {\n if (!preProcessor) {\n return acc;\n }\n return preProcessor(acc, context);\n }, value);\n }, []);\n const preProcessingPrivateApi = {\n registerPipeProcessor,\n registerPipeApplier,\n requestPipeProcessorsApplication\n };\n const preProcessingPublicApi = {\n unstable_applyPipeProcessors: applyPipeProcessors\n };\n useGridApiMethod(apiRef, preProcessingPrivateApi, 'private');\n useGridApiMethod(apiRef, preProcessingPublicApi, 'public');\n};","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _toPropertyKey from \"@babel/runtime/helpers/esm/toPropertyKey\";\nimport * as React from 'react';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nexport const GRID_DEFAULT_STRATEGY = 'none';\nexport const GRID_STRATEGIES_PROCESSORS = {\n rowTreeCreation: 'rowTree',\n filtering: 'rowTree',\n sorting: 'rowTree'\n};\n/**\n * Implements a variant of the Strategy Pattern (see https://en.wikipedia.org/wiki/Strategy_pattern)\n *\n * More information and detailed example in (TODO add link to technical doc when ready)\n *\n * Some plugins contains custom logic that must only be applied if the right strategy is active.\n * For instance, the row grouping plugin has a custom filtering algorithm.\n * This algorithm must be applied by the filtering plugin if the row grouping is the current way of grouping rows,\n * but not if the tree data is the current way of grouping rows.\n *\n * =====================================================================================================================\n *\n * The plugin containing the custom logic must use:\n *\n * - `useGridRegisterStrategyProcessor` to register their processor.\n * When the processor of the active strategy changes, it will fire `\"activeStrategyProcessorChange\"` to re-apply the processor.\n *\n * - `apiRef.current.setStrategyAvailability` to tell if their strategy can be used.\n *\n * =====================================================================================================================\n *\n * The plugin or component that needs to apply the custom logic of the current strategy must use:\n *\n * - `apiRef.current.applyStrategyProcessor` to run the processor of the active strategy for a given processor name.\n *\n * - the \"strategyAvailabilityChange\" event to update something when the active strategy changes.\n * Warning: Be careful not to apply the processor several times.\n * For instance \"rowsSet\" is fired by `useGridRows` whenever the active strategy changes.\n * So listening to both would most likely run your logic twice.\n *\n * - The \"activeStrategyProcessorChange\" event to update something when the processor of the active strategy changes.\n *\n * =====================================================================================================================\n *\n * Each processor name is part of a strategy group which can only have one active strategy at the time.\n * For now, there is only one strategy group named `rowTree` which customize\n * - row tree creation algorithm.\n * - sorting algorithm.\n * - filtering algorithm.\n */\nexport const useGridStrategyProcessing = apiRef => {\n const availableStrategies = React.useRef(new Map());\n const strategiesCache = React.useRef({});\n const registerStrategyProcessor = React.useCallback((strategyName, processorName, processor) => {\n const cleanup = () => {\n const _ref = strategiesCache.current[processorName],\n otherProcessors = _objectWithoutPropertiesLoose(_ref, [strategyName].map(_toPropertyKey));\n strategiesCache.current[processorName] = otherProcessors;\n };\n if (!strategiesCache.current[processorName]) {\n strategiesCache.current[processorName] = {};\n }\n const groupPreProcessors = strategiesCache.current[processorName];\n const previousProcessor = groupPreProcessors[strategyName];\n groupPreProcessors[strategyName] = processor;\n if (!previousProcessor || previousProcessor === processor) {\n return cleanup;\n }\n if (strategyName === apiRef.current.getActiveStrategy(GRID_STRATEGIES_PROCESSORS[processorName])) {\n apiRef.current.publishEvent('activeStrategyProcessorChange', processorName);\n }\n return cleanup;\n }, [apiRef]);\n const applyStrategyProcessor = React.useCallback((processorName, params) => {\n const activeStrategy = apiRef.current.getActiveStrategy(GRID_STRATEGIES_PROCESSORS[processorName]);\n if (activeStrategy == null) {\n throw new Error(\"Can't apply a strategy processor before defining an active strategy\");\n }\n const groupCache = strategiesCache.current[processorName];\n if (!groupCache || !groupCache[activeStrategy]) {\n throw new Error(`No processor found for processor \"${processorName}\" on strategy \"${activeStrategy}\"`);\n }\n const processor = groupCache[activeStrategy];\n return processor(params);\n }, [apiRef]);\n const getActiveStrategy = React.useCallback(strategyGroup => {\n var _availableStrategyEnt;\n const strategyEntries = Array.from(availableStrategies.current.entries());\n const availableStrategyEntry = strategyEntries.find(([, strategy]) => {\n if (strategy.group !== strategyGroup) {\n return false;\n }\n return strategy.isAvailable();\n });\n return (_availableStrategyEnt = availableStrategyEntry == null ? void 0 : availableStrategyEntry[0]) != null ? _availableStrategyEnt : GRID_DEFAULT_STRATEGY;\n }, []);\n const setStrategyAvailability = React.useCallback((strategyGroup, strategyName, isAvailable) => {\n availableStrategies.current.set(strategyName, {\n group: strategyGroup,\n isAvailable\n });\n apiRef.current.publishEvent('strategyAvailabilityChange');\n }, [apiRef]);\n const strategyProcessingApi = {\n registerStrategyProcessor,\n applyStrategyProcessor,\n getActiveStrategy,\n setStrategyAvailability\n };\n useGridApiMethod(apiRef, strategyProcessingApi, 'private');\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"stateId\"];\nimport * as React from 'react';\nimport { GridSignature } from '../utils/useGridApiEventHandler';\nimport { useGridApiMethod } from '../utils';\nimport { isFunction } from '../../utils/utils';\nexport const useGridStateInitialization = (apiRef, props) => {\n const controlStateMapRef = React.useRef({});\n const [, rawForceUpdate] = React.useState();\n const registerControlState = React.useCallback(controlStateItem => {\n const {\n stateId\n } = controlStateItem,\n others = _objectWithoutPropertiesLoose(controlStateItem, _excluded);\n controlStateMapRef.current[stateId] = _extends({}, others, {\n stateId\n });\n }, []);\n const setState = React.useCallback((state, reason) => {\n let newState;\n if (isFunction(state)) {\n newState = state(apiRef.current.state);\n } else {\n newState = state;\n }\n if (apiRef.current.state === newState) {\n return false;\n }\n let ignoreSetState = false;\n\n // Apply the control state constraints\n const updatedControlStateIds = [];\n Object.keys(controlStateMapRef.current).forEach(stateId => {\n const controlState = controlStateMapRef.current[stateId];\n const oldSubState = controlState.stateSelector(apiRef.current.state, apiRef.current.instanceId);\n const newSubState = controlState.stateSelector(newState, apiRef.current.instanceId);\n if (newSubState === oldSubState) {\n return;\n }\n updatedControlStateIds.push({\n stateId: controlState.stateId,\n hasPropChanged: newSubState !== controlState.propModel\n });\n\n // The state is controlled, the prop should always win\n if (controlState.propModel !== undefined && newSubState !== controlState.propModel) {\n ignoreSetState = true;\n }\n });\n if (updatedControlStateIds.length > 1) {\n // Each hook modify its own state, and it should not leak\n // Events are here to forward to other hooks and apply changes.\n // You are trying to update several states in a no isolated way.\n throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${updatedControlStateIds[0].stateId}, therefore, you're not allowed to update ${updatedControlStateIds.map(el => el.stateId).join(', ')} in the same transaction.`);\n }\n if (!ignoreSetState) {\n // We always assign it as we mutate rows for perf reason.\n apiRef.current.state = newState;\n if (apiRef.current.publishEvent) {\n apiRef.current.publishEvent('stateChange', newState);\n }\n }\n if (updatedControlStateIds.length === 1) {\n const {\n stateId,\n hasPropChanged\n } = updatedControlStateIds[0];\n const controlState = controlStateMapRef.current[stateId];\n const model = controlState.stateSelector(newState, apiRef.current.instanceId);\n if (controlState.propOnChange && hasPropChanged) {\n const details = props.signature === GridSignature.DataGridPro ? {\n api: apiRef.current,\n reason\n } : {\n reason\n };\n controlState.propOnChange(model, details);\n }\n if (!ignoreSetState) {\n apiRef.current.publishEvent(controlState.changeEvent, model, {\n reason\n });\n }\n }\n return !ignoreSetState;\n }, [apiRef, props.signature]);\n const updateControlState = React.useCallback((key, state, reason) => {\n return apiRef.current.setState(previousState => {\n return _extends({}, previousState, {\n [key]: state(previousState[key])\n });\n }, reason);\n }, [apiRef]);\n const forceUpdate = React.useCallback(() => rawForceUpdate(() => apiRef.current.state), [apiRef]);\n const publicStateApi = {\n setState,\n forceUpdate\n };\n const privateStateApi = {\n updateControlState,\n registerControlState\n };\n useGridApiMethod(apiRef, publicStateApi, 'public');\n useGridApiMethod(apiRef, privateStateApi, 'private');\n};","import { useGridLoggerFactory } from './useGridLoggerFactory';\nimport { useGridApiInitialization } from './useGridApiInitialization';\nimport { useGridLocaleText } from './useGridLocaleText';\nimport { useGridPipeProcessing } from './pipeProcessing';\nimport { useGridStrategyProcessing } from './strategyProcessing';\nimport { useGridStateInitialization } from './useGridStateInitialization';\n\n/**\n * Initialize the technical pieces of the DataGrid (logger, state, ...) that any DataGrid implementation needs\n */\nexport const useGridInitialization = (inputApiRef, props) => {\n const privateApiRef = useGridApiInitialization(inputApiRef, props);\n useGridLoggerFactory(privateApiRef, props);\n useGridStateInitialization(privateApiRef, props);\n useGridPipeProcessing(privateApiRef);\n useGridStrategyProcessing(privateApiRef);\n useGridLocaleText(privateApiRef, props);\n return privateApiRef;\n};","import * as React from 'react';\nexport const useGridLocaleText = (apiRef, props) => {\n const getLocaleText = React.useCallback(key => {\n if (props.localeText[key] == null) {\n throw new Error(`Missing translation for key ${key}.`);\n }\n return props.localeText[key];\n }, [props.localeText]);\n apiRef.current.register('public', {\n getLocaleText\n });\n};","import * as React from 'react';\nexport const useGridInitializeState = (initializer, privateApiRef, props) => {\n const isInitialized = React.useRef(false);\n if (!isInitialized.current) {\n privateApiRef.current.state = initializer(privateApiRef.current.state, props, privateApiRef);\n isInitialized.current = true;\n }\n};","import * as React from 'react';\nexport function useGridLogger(privateApiRef, name) {\n const logger = React.useRef(null);\n if (logger.current) {\n return logger.current;\n }\n const newLogger = privateApiRef.current.getLogger(name);\n logger.current = newLogger;\n return newLogger;\n}","import * as React from 'react';\nimport { useGridApiMethod, useGridNativeEventListener } from '../../utils';\nfunction writeToClipboardPolyfill(data) {\n const span = document.createElement('span');\n span.style.whiteSpace = 'pre';\n span.style.userSelect = 'all';\n span.style.opacity = '0px';\n span.textContent = data;\n document.body.appendChild(span);\n const range = document.createRange();\n range.selectNode(span);\n const selection = window.getSelection();\n selection.removeAllRanges();\n selection.addRange(range);\n try {\n document.execCommand('copy');\n } finally {\n document.body.removeChild(span);\n }\n}\nfunction hasNativeSelection(element) {\n var _window$getSelection;\n // When getSelection is called on an